mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Format StmtAugAssign (#5655)
## Summary Format statements such as `tree_depth += 1`. This is a statement that does not allow any line breaks, the only thing to be mindful of is to parenthesize the assigned expression Jaccard index on django: 0.915 -> 0.918 ## Test Plan black tests, and two new tests, a basic one and one that ensures that the child gets parentheses. I ran the django stability check.
This commit is contained in:
parent
15c7b6bcf7
commit
b7794f855b
6 changed files with 56 additions and 27 deletions
5
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/ann_assign.py
vendored
Normal file
5
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/ann_assign.py
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
tree_depth += 1
|
||||
|
||||
greeting += "This is very long, formal greeting for whomever is name here. Dear %s, it will break the line" % len(
|
||||
name
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue