Skip to content

Warn about inconsistent indentation - #8975

Closed
phadej wants to merge 3 commits into
haskell:masterfrom
phadej:warn-inconsistent-indentation
Closed

phadej wants to merge 3 commits into
haskell:masterfrom
phadej:warn-inconsistent-indentation

Conversation

@phadej

@phadej phadej commented May 28, 2023

Copy link
Copy Markdown
Collaborator

This is an effect of using indentOfAtLeast method: any indentation greater than current offset is fine.

That behavior is desirable to parsing multiline field contents, but it is a bit surprising for fields in sections, which we expect to be aligned.

Such insonsistency seems to be always a mistake, and it's easy to fix once a machine points it out.

@phadej
phadej force-pushed the warn-inconsistent-indentation branch from 8d6bd99 to 6944cb0 Compare May 28, 2023 13:57
@phadej
phadej force-pushed the warn-inconsistent-indentation branch from 6944cb0 to 7a458a6 Compare May 28, 2023 15:21
@phadej

phadej commented May 28, 2023

Copy link
Copy Markdown
Collaborator Author

I had to adjust lexer slightly as BOM and NBSP where throwing source locations a bit off causing cascading indentation warnings.

@phadej
phadej force-pushed the warn-inconsistent-indentation branch 2 times, most recently from 4a7d23e to b27e6df Compare May 28, 2023 15:38
@phadej
phadej requested review from ffaf1 and ulysses4ever May 28, 2023 15:39
@phadej
phadej force-pushed the warn-inconsistent-indentation branch 2 times, most recently from 147ed3e to 732de92 Compare May 28, 2023 17:13
This helps disabling individual packages (e.g. cabal-testsuite)
@phadej
phadej force-pushed the warn-inconsistent-indentation branch 3 times, most recently from 19e5c4d to 2c407cf Compare May 28, 2023 21:03

@ulysses4ever ulysses4ever left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to adjust lexer slightly as BOM and NBSP where throwing source locations a bit off causing cascading indentation warnings.

This sounds a bit worrying. Have you seen the discussion at #8896? Don't we step on each others toes here?

At the very least, the Lexer change sounds like something that should go into a separate commit.

Comment thread changelog.d/inconsistent-indentation Resolved
phadej added 2 commits May 29, 2023 06:29
This is affect of using indentOfAtLeast method:
any indentation greater than current offset is fine.

That behavior is desirable to parsing multiline field contents,
but it is a bit surprising for fields, which we expect to be aligned.

Such insonsistency seems to be always a mistake, and it's easy to fix once
a machine points it out.
@phadej
phadej force-pushed the warn-inconsistent-indentation branch from 2c407cf to 37edda4 Compare May 29, 2023 03:35
@phadej
phadej requested a review from ulysses4ever May 29, 2023 03:37
@phadej

phadej commented Jun 9, 2023

Copy link
Copy Markdown
Collaborator Author

ping

@Mikolaj Mikolaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot. Please kindly set one of the merge labels.

@phadej

phadej commented Jun 9, 2023

Copy link
Copy Markdown
Collaborator Author

I don't have (and don't want) write permissions to this repository.

@ulysses4ever ulysses4ever added merge me Tell Mergify Bot to merge and removed attention: needs-review labels Jun 9, 2023
@ulysses4ever

Copy link
Copy Markdown
Collaborator

@phadej no worries, I did the labeling. Thanks again! Btw, #8983 has one commit in common with this PR, so maybe it'll need a rebase at some point...

@mergify mergify Bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Jun 11, 2023
@phadej

phadej commented Jun 19, 2023

Copy link
Copy Markdown
Collaborator Author

Why isn't this merged? There isn't conflict?

@ulysses4ever

Copy link
Copy Markdown
Collaborator

@mergify rebase

@mergify

mergify Bot commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

rebase

❌ Pull request can't be updated with latest base branch changes

Details

Mergify needs the author permission to update the base branch of the pull request.
@phadej needs to authorize modification on its head branch.
err-code: 14823

@ulysses4ever

Copy link
Copy Markdown
Collaborator

@phadej on it. Sorry for the delay.

@ulysses4ever

Copy link
Copy Markdown
Collaborator

@mergify refresh

@mergify

mergify Bot commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

refresh

✅ Pull request refreshed

@Mikolaj

Mikolaj commented Jun 20, 2023

Copy link
Copy Markdown
Member

@mergify refresh

@mergify

mergify Bot commented Jun 20, 2023

Copy link
Copy Markdown
Contributor

refresh

✅ Pull request refreshed

@Mikolaj

Mikolaj commented Jun 20, 2023

Copy link
Copy Markdown
Member

@mergify rebase

@mergify

mergify Bot commented Jun 20, 2023

Copy link
Copy Markdown
Contributor

rebase

❌ Pull request can't be updated with latest base branch changes

Details

Mergify needs the author permission to update the base branch of the pull request.
@phadej needs to authorize modification on its head branch.
err-code: 5D20E

@Mikolaj

Mikolaj commented Jun 20, 2023

Copy link
Copy Markdown
Member

Oh dear.

@Mikolaj

Mikolaj commented Jun 20, 2023

Copy link
Copy Markdown
Member

@phadej: we have technical problems; is it fine if I squash the PR when merging? If not, we'd probably need to open a new PR and move it there, but it's work and an indirection.

@ulysses4ever

Copy link
Copy Markdown
Collaborator

@Mikolaj Oleg was very clear about it: he won't allow updates. We'll have to manually copy his branches to our repository and open new PRs using those copies. I am afraid it'll be hard to find volunteers to do this monkey job.

@ffaf1 ffaf1 mentioned this pull request Jun 20, 2023
4 tasks
@Mikolaj

Mikolaj commented Jun 20, 2023 •

Copy link
Copy Markdown
Member

@ulysses4ever: I thought the merge+squash button would be a cheap way out. Wouldn't it work? In any case, @ffaf1 did it in a more principled way, so let's merge his PR.

@ulysses4ever

Copy link
Copy Markdown
Collaborator

@Mikolaj unless I'm missing something, Mergify is completely strangled by not being able to update the branch. Perhaps, you could work around Mergify by clicking GitHub buttons for squash and merge, see the screenshot.
Screenshot_20230620-105247

But I find it a bit dangerous to apply both merge approaches (GH and Mergify) on one repository concurrently.

@Mikolaj

Mikolaj commented Jun 20, 2023 •

Copy link
Copy Markdown
Member

Yes, the button is what I meant. If the button works, then mergify does not cut in. Unless I'm missing something. However, we lose the separate commits.

@ulysses4ever

Copy link
Copy Markdown
Collaborator

Mergify may be surprised that, half-way merging some other PR into master, master suddenly updates. Or the other way around. If you choose exactly the right time for it, I don't see how they (GH and the bot) avoid racing (and these days are rather hot in terms of merging stuff). And then it's the question whether they implemented critical sections correctly. Which I wouldn't bet my money on this.

@Mikolaj

Mikolaj commented Jun 20, 2023

Copy link
Copy Markdown
Member

Huh, I'd hope git would cope fine and then mergify or github trying to merge something absurd would be rebuked by git. OTOH, if they promptly retry with enough reset --hard to convince git, I'm afraid your vision may be right. :[

mergify Bot added a commit that referenced this pull request Jun 22, 2023
@ffaf1

ffaf1 commented Jun 22, 2023

Copy link
Copy Markdown
Collaborator

Merged in #9051.

@ffaf1 ffaf1 closed this Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants