Skip to content

Commit c6d8076

Browse files
authored
Set target versions in Black tests (#9221)
1 parent 8cb7950 commit c6d8076

55 files changed

Lines changed: 996 additions & 466 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# split out from comments2 as it does not work with line-length=1, losing the comment
2+
a = "type comment with trailing space" # type: str
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# split out from comments2 as it does not work with line-length=1, losing the comment
2+
a = "type comment with trailing space" # type: str

crates/ruff_python_formatter/resources/test/fixtures/black/cases/comments2.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ def _init_host(self, parsed) -> None:
155155
pass
156156

157157

158-
a = "type comment with trailing space" # type: str
159-
160158
#######################
161159
### SECTION COMMENT ###
162160
#######################

crates/ruff_python_formatter/resources/test/fixtures/black/cases/comments2.py.expect

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ class Test:
162162
pass
163163

164164

165-
a = "type comment with trailing space" # type: str
166-
167165
#######################
168166
### SECTION COMMENT ###
169167
#######################
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# l2 loses the comment with line-length=1 in preview mode
12
l1 = ["This list should be broken up", "into multiple lines", "because it is way too long"]
23
l2 = ["But this list shouldn't", "even though it also has", "way too many characters in it"] # fmt: skip
34
l3 = ["I have", "trailing comma", "so I should be braked",]

crates/ruff_python_formatter/resources/test/fixtures/black/cases/fmtskip2.py.expect

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# l2 loses the comment with line-length=1 in preview mode
12
l1 = [
23
"This list should be broken up",
34
"into multiple lines",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"preview": "enabled"}
1+
{"preview": "enabled", "target_version": "py310"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"target_version": "py310"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"target_version": "py310"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"target_version": "py310"}

0 commit comments

Comments
 (0)