-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05cbaab
commit bdab1c2
Showing
19 changed files
with
765 additions
and
61 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_on_off/.editorconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[mixed_space_and_tab.py] | ||
generated_code = true | ||
ij_formatter_enabled = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...f_python_formatter/resources/test/fixtures/ruff/fmt_on_off/fmt_off_docstring.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[ | ||
{ | ||
"indent_style": { "Space": 4 } | ||
}, | ||
{ | ||
"indent_style": { "Space": 2 } | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_on_off/indent.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"indent_style": { "Space": 4 } | ||
}, | ||
{ | ||
"indent_style": { "Space": 1 } | ||
}, | ||
{ | ||
"indent_style": "Tab" | ||
} | ||
] |
40 changes: 40 additions & 0 deletions
40
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_on_off/indent.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
def test(): | ||
# fmt: off | ||
a_very_small_indent | ||
( | ||
not_fixed | ||
) | ||
|
||
if True: | ||
pass | ||
more | ||
# fmt: on | ||
|
||
formatted | ||
|
||
def test(): | ||
a_small_indent | ||
# fmt: off | ||
# fix under-indented comments | ||
(or_the_inner_expression + | ||
expressions | ||
) | ||
|
||
if True: | ||
pass | ||
# fmt: on | ||
|
||
|
||
# fmt: off | ||
def test(): | ||
pass | ||
|
||
# It is necessary to indent comments because the following fmt: on comment because it otherwise becomes a trailing comment | ||
# of the `test` function if the "proper" indentation is larger than 2 spaces. | ||
# fmt: on | ||
|
||
disabled + formatting; | ||
|
||
# fmt: on | ||
|
||
formatted; |
11 changes: 11 additions & 0 deletions
11
...python_formatter/resources/test/fixtures/ruff/fmt_on_off/mixed_space_and_tab.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"indent_style": { "Space": 4 } | ||
}, | ||
{ | ||
"indent_style": { "Space": 2 } | ||
}, | ||
{ | ||
"indent_style": "Tab" | ||
} | ||
] |
15 changes: 15 additions & 0 deletions
15
crates/ruff_python_formatter/resources/test/fixtures/ruff/fmt_on_off/mixed_space_and_tab.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
def test(): | ||
# fmt: off | ||
a_very_small_indent | ||
( | ||
not_fixed | ||
) | ||
|
||
if True: | ||
# Fun tab, space, tab, space. Followed by space, tab, tab, space | ||
pass | ||
more | ||
else: | ||
other | ||
# fmt: on | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.