Skip to content

Commit

Permalink
Remove no longer needed preview: true options from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Jan 3, 2025
1 parent 5cd85f1 commit 62633a3
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 80 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[
{
"quote_style": "preserve",
"preview": "enabled"
"quote_style": "preserve"
},
{
"quote_style": "preserve",
"preview": "enabled",
"target_version": "py312"
}
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[
{
"preview": "enabled",
"source_type": "Stub"
}
]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -355,22 +355,7 @@ f"aaaaaaaaaaaaaaaa \
)
```
## Outputs
### Output 1
```
indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
docstring-code-line-width = "dynamic"
preview = Enabled
target_version = Py39
source_type = Python
```
## Output
```python
"aaaaaaaaabbbbbbbbbbbbbbbbbbbb" # Join
Expand Down Expand Up @@ -616,12 +601,9 @@ assert (
##############################################################################
# Use can_omit_optional_parentheses layout to avoid an instability where the formatter
# picks the can_omit_optional_parentheses layout when the strings are joined.
if f"implicitconcatenatedstring" + f"implicitconcadddddddddddedring" * len([
aaaaaa,
bbbbbbbbbbbbbbbb,
cccccccccccccccccc,
ddddddddddddddddddddddddddd,
]):
if f"implicitconcatenatedstring" + f"implicitconcadddddddddddedring" * len(
[aaaaaa, bbbbbbbbbbbbbbbb, cccccccccccccccccc, ddddddddddddddddddddddddddd]
):
pass
# Keep parenthesizing multiline - implicit concatenated strings
Expand Down Expand Up @@ -792,3 +774,26 @@ f"aaaaaaaaaaaaaaaa \
ddddddddddddddddddd" # comment 4
)
```
## Preview changes
```diff
--- Stable
+++ Preview
@@ -242,9 +242,12 @@
##############################################################################
# Use can_omit_optional_parentheses layout to avoid an instability where the formatter
# picks the can_omit_optional_parentheses layout when the strings are joined.
-if f"implicitconcatenatedstring" + f"implicitconcadddddddddddedring" * len(
- [aaaaaa, bbbbbbbbbbbbbbbb, cccccccccccccccccc, ddddddddddddddddddddddddddd]
-):
+if f"implicitconcatenatedstring" + f"implicitconcadddddddddddedring" * len([
+ aaaaaa,
+ bbbbbbbbbbbbbbbb,
+ cccccccccccccccccc,
+ ddddddddddddddddddddddddddd,
+]):
pass
# Keep parenthesizing multiline - implicit concatenated strings
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string_assignment.py
snapshot_kind: text
---
## Input
```python
Expand Down Expand Up @@ -300,22 +299,7 @@ aaaaa[aaaaaaaaaaa] = (
)
```

## Outputs
### Output 1
```
indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
docstring-code-line-width = "dynamic"
preview = Enabled
target_version = Py39
source_type = Python
```

## Output
```python
## Implicit concatenated strings with a trailing comment but a non splittable target.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string_preserve.py
snapshot_kind: text
---
## Input
```python
Expand Down Expand Up @@ -31,7 +30,7 @@ line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
docstring-code-line-width = "dynamic"
preview = Enabled
preview = Disabled
target_version = Py39
source_type = Python
```
Expand Down Expand Up @@ -63,7 +62,7 @@ line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
docstring-code-line-width = "dynamic"
preview = Enabled
preview = Disabled
target_version = Py312
source_type = Python
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/range_formatting/stub.pyi
snapshot_kind: text
---
## Input
```python
Expand Down Expand Up @@ -34,7 +33,7 @@ line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
docstring-code-line-width = "dynamic"
preview = Enabled
preview = Disabled
target_version = Py39
source_type = Stub
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/assignment_split_value_first.py
snapshot_kind: text
---
## Input
```python
Expand Down Expand Up @@ -242,22 +241,7 @@ type A[VeryLongTypeNameThatShouldBreakFirstToTheRightBeforeSplitngtinthatExceeds
```

## Outputs
### Output 1
```
indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
docstring-code-line-width = "dynamic"
preview = Enabled
target_version = Py39
source_type = Python
```

## Output
```python
#######
# Unsplittable target and value
Expand Down

0 comments on commit 62633a3

Please sign in to comment.