Repository navigation
Fix format --check spans for syntax errors - #27045
Merged
Merged
Conversation
Summary -- This PR fixes #24528 by attaching more information to `FormatCommandError::Parse` instances. I made a couple of attempts at Micha's suggestion [1] to convert to `Diagnostic`s much earlier, but doing this only for errors was pretty awkward while still producing a much larger diff. I think it would be better to use diagnostics more deeply both for the error and non-error cases eventually, which should also help with #8232, but I considered the limited fix here a better stopgap for the 0.16 release. [1]: #24528 (comment) Test Plan -- Updated snapshots for two existing tests, plus an additional notebook test
|
ntBre
marked this pull request as ready for review
July 21, 2026 16:07
MichaReiser
approved these changes
Jul 21, 2026
| --> test.py:1:1 | ||
| | | ||
| 1 | 1 | ||
| | ^ |
Member
There was a problem hiding this comment.
This looks funny. Is this another poor parser diagnostic? I don't see any indentation?
Contributor
Author
There was a problem hiding this comment.
These are all synthetic diagnostics to test the rendering. This one is constructed on line 1294 above with a default range, and the input is just a "1" for all of them.
This was referenced Jul 21, 2026
ntBre
added a commit
that referenced
this pull request
Jul 21, 2026
Summary -- This PR fixes #24528 by attaching more information to `FormatCommandError::Parse` instances. I made a couple of attempts at Micha's suggestion ([1]) to convert to `Diagnostic`s much earlier, but doing this only for errors was pretty awkward while still producing a much larger diff. I think it would be better to use diagnostics more deeply both for the error and non-error cases eventually, which should also help with #8232, but I considered the limited fix here a better stopgap for the 0.16 release. [1]: #24528 (comment) Test Plan -- Updated snapshots for two existing tests, plus an additional notebook test
ntBre
added a commit
that referenced
this pull request
Jul 22, 2026
Summary -- This PR fixes #24528 by attaching more information to `FormatCommandError::Parse` instances. I made a couple of attempts at Micha's suggestion ([1]) to convert to `Diagnostic`s much earlier, but doing this only for errors was pretty awkward while still producing a much larger diff. I think it would be better to use diagnostics more deeply both for the error and non-error cases eventually, which should also help with #8232, but I considered the limited fix here a better stopgap for the 0.16 release. [1]: #24528 (comment) Test Plan -- Updated snapshots for two existing tests, plus an additional notebook test
ntBre
added a commit
that referenced
this pull request
Jul 23, 2026
Summary -- This PR fixes #24528 by attaching more information to `FormatCommandError::Parse` instances. I made a couple of attempts at Micha's suggestion ([1]) to convert to `Diagnostic`s much earlier, but doing this only for errors was pretty awkward while still producing a much larger diff. I think it would be better to use diagnostics more deeply both for the error and non-error cases eventually, which should also help with #8232, but I considered the limited fix here a better stopgap for the 0.16 release. [1]: #24528 (comment) Test Plan -- Updated snapshots for two existing tests, plus an additional notebook test
ntBre
added a commit
that referenced
this pull request
Jul 23, 2026
Summary -- This PR fixes #24528 by attaching more information to `FormatCommandError::Parse` instances. I made a couple of attempts at Micha's suggestion ([1]) to convert to `Diagnostic`s much earlier, but doing this only for errors was pretty awkward while still producing a much larger diff. I think it would be better to use diagnostics more deeply both for the error and non-error cases eventually, which should also help with #8232, but I considered the limited fix here a better stopgap for the 0.16 release. [1]: #24528 (comment) Test Plan -- Updated snapshots for two existing tests, plus an additional notebook test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes #24528 by attaching more information to
FormatCommandError::Parseinstances. I madea couple of attempts at Micha's suggestion (1) to convert to
Diagnostics much earlier, but doingthis only for errors was pretty awkward while still producing a much larger diff. I think it would
be better to use diagnostics more deeply both for the error and non-error cases eventually, which
should also help with #8232, but I considered the limited fix here a better stopgap for the 0.16
release.
Test Plan
Updated snapshots for two existing tests, plus an additional notebook test