-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix formatting lambda with empty arguments #5944
Conversation
**Summary** Fix implemented in astral-sh/RustPython-Parser#35: Previously, empty lambda arguments (e.g. `lambda: 1`) would get the range of the entire expression, which leads to incorrect comment placement. Now empty lambda arguments get an empty range between the `lambda` and the `:` tokens. **Test Plan** Added a regression test. 149 instances of unstable formatting remaining. ``` $ cargo run --bin ruff_dev --release -- format-dev --stability-check --error-file formatter-ecosystem-errors.txt --multi-project target/checkouts > formatter-ecosystem-progress.txt $ rg "Unstable formatting" target/formatter-ecosystem-errors.txt | wc -l 149 ```
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
721efed
to
62deacb
Compare
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
1dd8126
to
62deacb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
149 instances of unstable formatting remaining.
From how many initial regressions?
197 was the last measurement before, but i haven't keeping track of which are mine and which are unrelated from main |
Summary Fix implemented in astral-sh/RustPython-Parser#35: Previously, empty lambda arguments (e.g.
lambda: 1
) would get the range of the entire expression, which leads to incorrect comment placement. Now empty lambda arguments get an empty range between thelambda
and the:
tokens.Test Plan Added a regression test.
149 instances of unstable formatting remaining.