Skip to content

Commit 62633a3

Browse files
committed
Remove no longer needed preview: true options from tests
1 parent 5cd85f1 commit 62633a3

10 files changed

+33
-80
lines changed

crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string.options.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string_assignment.options.json

Lines changed: 0 additions & 5 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
[
22
{
3-
"quote_style": "preserve",
4-
"preview": "enabled"
3+
"quote_style": "preserve"
54
},
65
{
76
"quote_style": "preserve",
8-
"preview": "enabled",
97
"target_version": "py312"
108
}
119
]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[
22
{
3-
"preview": "enabled",
43
"source_type": "Stub"
54
}
65
]

crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/assignment_split_value_first.options.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

crates/ruff_python_formatter/tests/snapshots/format@expression__join_implicit_concatenated_string.py.snap

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -355,22 +355,7 @@ f"aaaaaaaaaaaaaaaa \
355355
)
356356
```
357357
358-
## Outputs
359-
### Output 1
360-
```
361-
indent-style = space
362-
line-width = 88
363-
indent-width = 4
364-
quote-style = Double
365-
line-ending = LineFeed
366-
magic-trailing-comma = Respect
367-
docstring-code = Disabled
368-
docstring-code-line-width = "dynamic"
369-
preview = Enabled
370-
target_version = Py39
371-
source_type = Python
372-
```
373-
358+
## Output
374359
```python
375360
"aaaaaaaaabbbbbbbbbbbbbbbbbbbb" # Join
376361
@@ -616,12 +601,9 @@ assert (
616601
##############################################################################
617602
# Use can_omit_optional_parentheses layout to avoid an instability where the formatter
618603
# picks the can_omit_optional_parentheses layout when the strings are joined.
619-
if f"implicitconcatenatedstring" + f"implicitconcadddddddddddedring" * len([
620-
aaaaaa,
621-
bbbbbbbbbbbbbbbb,
622-
cccccccccccccccccc,
623-
ddddddddddddddddddddddddddd,
624-
]):
604+
if f"implicitconcatenatedstring" + f"implicitconcadddddddddddedring" * len(
605+
[aaaaaa, bbbbbbbbbbbbbbbb, cccccccccccccccccc, ddddddddddddddddddddddddddd]
606+
):
625607
pass
626608
627609
# Keep parenthesizing multiline - implicit concatenated strings
@@ -792,3 +774,26 @@ f"aaaaaaaaaaaaaaaa \
792774
ddddddddddddddddddd" # comment 4
793775
)
794776
```
777+
778+
779+
## Preview changes
780+
```diff
781+
--- Stable
782+
+++ Preview
783+
@@ -242,9 +242,12 @@
784+
##############################################################################
785+
# Use can_omit_optional_parentheses layout to avoid an instability where the formatter
786+
# picks the can_omit_optional_parentheses layout when the strings are joined.
787+
-if f"implicitconcatenatedstring" + f"implicitconcadddddddddddedring" * len(
788+
- [aaaaaa, bbbbbbbbbbbbbbbb, cccccccccccccccccc, ddddddddddddddddddddddddddd]
789+
-):
790+
+if f"implicitconcatenatedstring" + f"implicitconcadddddddddddedring" * len([
791+
+ aaaaaa,
792+
+ bbbbbbbbbbbbbbbb,
793+
+ cccccccccccccccccc,
794+
+ ddddddddddddddddddddddddddd,
795+
+]):
796+
pass
797+
798+
# Keep parenthesizing multiline - implicit concatenated strings
799+
```

crates/ruff_python_formatter/tests/snapshots/format@expression__join_implicit_concatenated_string_assignment.py.snap

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/ruff_python_formatter/tests/fixtures.rs
33
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string_assignment.py
4-
snapshot_kind: text
54
---
65
## Input
76
```python
@@ -300,22 +299,7 @@ aaaaa[aaaaaaaaaaa] = (
300299
)
301300
```
302301

303-
## Outputs
304-
### Output 1
305-
```
306-
indent-style = space
307-
line-width = 88
308-
indent-width = 4
309-
quote-style = Double
310-
line-ending = LineFeed
311-
magic-trailing-comma = Respect
312-
docstring-code = Disabled
313-
docstring-code-line-width = "dynamic"
314-
preview = Enabled
315-
target_version = Py39
316-
source_type = Python
317-
```
318-
302+
## Output
319303
```python
320304
## Implicit concatenated strings with a trailing comment but a non splittable target.
321305

crates/ruff_python_formatter/tests/snapshots/format@expression__join_implicit_concatenated_string_preserve.py.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/ruff_python_formatter/tests/fixtures.rs
33
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string_preserve.py
4-
snapshot_kind: text
54
---
65
## Input
76
```python
@@ -31,7 +30,7 @@ line-ending = LineFeed
3130
magic-trailing-comma = Respect
3231
docstring-code = Disabled
3332
docstring-code-line-width = "dynamic"
34-
preview = Enabled
33+
preview = Disabled
3534
target_version = Py39
3635
source_type = Python
3736
```
@@ -63,7 +62,7 @@ line-ending = LineFeed
6362
magic-trailing-comma = Respect
6463
docstring-code = Disabled
6564
docstring-code-line-width = "dynamic"
66-
preview = Enabled
65+
preview = Disabled
6766
target_version = Py312
6867
source_type = Python
6968
```

crates/ruff_python_formatter/tests/snapshots/format@range_formatting__stub.pyi.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/ruff_python_formatter/tests/fixtures.rs
33
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/range_formatting/stub.pyi
4-
snapshot_kind: text
54
---
65
## Input
76
```python
@@ -34,7 +33,7 @@ line-ending = LineFeed
3433
magic-trailing-comma = Respect
3534
docstring-code = Disabled
3635
docstring-code-line-width = "dynamic"
37-
preview = Enabled
36+
preview = Disabled
3837
target_version = Py39
3938
source_type = Stub
4039
```

crates/ruff_python_formatter/tests/snapshots/format@statement__assignment_split_value_first.py.snap

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/ruff_python_formatter/tests/fixtures.rs
33
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/assignment_split_value_first.py
4-
snapshot_kind: text
54
---
65
## Input
76
```python
@@ -242,22 +241,7 @@ type A[VeryLongTypeNameThatShouldBreakFirstToTheRightBeforeSplitngtinthatExceeds
242241
243242
```
244243

245-
## Outputs
246-
### Output 1
247-
```
248-
indent-style = space
249-
line-width = 88
250-
indent-width = 4
251-
quote-style = Double
252-
line-ending = LineFeed
253-
magic-trailing-comma = Respect
254-
docstring-code = Disabled
255-
docstring-code-line-width = "dynamic"
256-
preview = Enabled
257-
target_version = Py39
258-
source_type = Python
259-
```
260-
244+
## Output
261245
```python
262246
#######
263247
# Unsplittable target and value

0 commit comments

Comments
 (0)