mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-30 23:27:27 +00:00
Add a test for stmt assign breaking in preview mode (#7516)
In preview mode, black will consistently break the right side first. This doesn't work yet, but we'll need the test later.
This commit is contained in:
parent
6dade5b9ab
commit
4ae463d04b
13 changed files with 208 additions and 2 deletions
|
@ -0,0 +1,8 @@
|
|||
[
|
||||
{
|
||||
"preview": "disabled"
|
||||
},
|
||||
{
|
||||
"preview": "enabled"
|
||||
}
|
||||
]
|
34
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/assign_breaking.py
vendored
Normal file
34
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/assign_breaking.py
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Below is black stable style
|
||||
# In preview style, black always breaks the right side first
|
||||
|
||||
if True:
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[
|
||||
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||
] = cccccccc.ccccccccccccc.cccccccc
|
||||
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[
|
||||
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||
] = cccccccc.ccccccccccccc().cccccccc
|
||||
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[
|
||||
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||
] = cccccccc.ccccccccccccc(d).cccccccc
|
||||
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = (
|
||||
cccccccc.ccccccccccccc(d).cccccccc + e
|
||||
)
|
||||
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = (
|
||||
cccccccc.ccccccccccccc.cccccccc + e
|
||||
)
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = (
|
||||
cccccccc.ccccccccccccc.cccccccc
|
||||
+ eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
|
||||
)
|
||||
|
||||
self._cache: dict[
|
||||
DependencyCacheKey, list[list[DependencyPackage]]
|
||||
] = collections.defaultdict(list)
|
||||
self._cached_dependencies_by_level: dict[
|
||||
int, list[DependencyCacheKey]
|
||||
] = collections.defaultdict(list)
|
Loading…
Add table
Add a link
Reference in a new issue