Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about inconsistent indentation #8975

Closed
wants to merge 3 commits into from

Conversation

phadej
Copy link
Collaborator

@phadej phadej commented May 28, 2023

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
Copy link
Collaborator Author

phadej commented May 28, 2023

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 ulysses4ever and ffaf1 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
Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

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.

changelog.d/inconsistent-indentation Outdated Show resolved Hide resolved
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
Copy link
Collaborator Author

phadej commented Jun 9, 2023

ping

Copy link
Member

@Mikolaj Mikolaj left a comment

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
Copy link
Collaborator Author

phadej commented Jun 9, 2023

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
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
Copy link
Collaborator Author

phadej commented Jun 19, 2023

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

@ulysses4ever
Copy link
Collaborator

@mergify rebase

@mergify
Copy link
Contributor

mergify bot commented Jun 19, 2023

rebase

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

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
Collaborator

@phadej on it. Sorry for the delay.

@ulysses4ever
Copy link
Collaborator

@mergify refresh

@mergify
Copy link
Contributor

mergify bot commented Jun 19, 2023

refresh

✅ Pull request refreshed

@Mikolaj
Copy link
Member

Mikolaj commented Jun 20, 2023

@mergify refresh

@mergify
Copy link
Contributor

mergify bot commented Jun 20, 2023

refresh

✅ Pull request refreshed

@Mikolaj
Copy link
Member

Mikolaj commented Jun 20, 2023

@mergify rebase

@mergify
Copy link
Contributor

mergify bot commented Jun 20, 2023

rebase

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

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
Copy link
Member

Mikolaj commented Jun 20, 2023

Oh dear.

@Mikolaj
Copy link
Member

Mikolaj commented Jun 20, 2023

@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
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
Copy link
Member

Mikolaj commented Jun 20, 2023

@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
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
Copy link
Member

Mikolaj commented Jun 20, 2023

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
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
Copy link
Member

Mikolaj commented Jun 20, 2023

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
Copy link
Collaborator

ffaf1 commented Jun 22, 2023

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