-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Implement blank_line_after_nested_stub_class preview style
#9155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...r/resources/test/fixtures/ruff/stub_files/blank_line_after_nested_stub_class.options.json
This file contains hidden or 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,6 @@ | ||
| [ | ||
| { | ||
| "source_type": "Stub", | ||
| "preview": "enabled" | ||
| } | ||
| ] |
183 changes: 183 additions & 0 deletions
183
..._formatter/resources/test/fixtures/ruff/stub_files/blank_line_after_nested_stub_class.pyi
This file contains hidden or 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,183 @@ | ||
| class Top1: | ||
| pass | ||
| class Top2: | ||
| pass | ||
|
|
||
| class Top: | ||
| class Ellipsis: ... | ||
| class Ellipsis: ... | ||
|
|
||
| class Top: | ||
| class Ellipsis: ... | ||
| class Pass: | ||
| pass | ||
|
|
||
| class Top: | ||
| class Ellipsis: ... | ||
| class_variable = 1 | ||
|
|
||
| class Top: | ||
| class TrailingComment: | ||
| pass | ||
| # comment | ||
| class Other: | ||
| pass | ||
|
|
||
| class Top: | ||
| class CommentWithEllipsis: ... | ||
| # comment | ||
| class Other: ... | ||
|
|
||
| class Top: | ||
| class TrailingCommentWithMultipleBlankLines: | ||
| pass | ||
|
|
||
|
|
||
| # comment | ||
| class Other: | ||
| pass | ||
|
|
||
| class Top: | ||
| class Nested: | ||
| pass | ||
|
|
||
| # comment | ||
| class LeadingComment: | ||
| pass | ||
|
|
||
| class Top: | ||
| @decorator | ||
| class Ellipsis: ... | ||
| class Ellipsis: ... | ||
|
|
||
| class Top: | ||
| @decorator | ||
| class Ellipsis: ... | ||
| @decorator | ||
| class Ellipsis: ... | ||
|
|
||
| class Top: | ||
| @decorator | ||
| class Ellipsis: ... | ||
| @decorator | ||
| class Pass: | ||
| pass | ||
|
|
||
| class Top: | ||
| class Foo: | ||
| pass | ||
|
|
||
|
|
||
|
|
||
|
|
||
| class AfterMultipleEmptyLines: | ||
| pass | ||
|
|
||
| class Top: | ||
| class Nested11: | ||
| class Nested12: | ||
| pass | ||
| class Nested21: | ||
| pass | ||
|
|
||
| class Top: | ||
| class Nested11: | ||
| class Nested12: | ||
| pass | ||
| # comment | ||
| class Nested21: | ||
| pass | ||
|
|
||
| class Top: | ||
| class Nested11: | ||
| class Nested12: | ||
| pass | ||
| # comment | ||
| class Nested21: | ||
| pass | ||
| # comment | ||
|
|
||
| class Top1: | ||
| class Nested: | ||
| pass | ||
| class Top2: | ||
| pass | ||
|
|
||
| class Top1: | ||
| class Nested: | ||
| pass | ||
| # comment | ||
| class Top2: | ||
| pass | ||
|
|
||
| class Top1: | ||
| class Nested: | ||
| pass | ||
| # comment | ||
| class Top2: | ||
| pass | ||
|
|
||
| if foo: | ||
| class Nested1: | ||
| pass | ||
| class Nested2: | ||
| pass | ||
| else: | ||
| pass | ||
|
|
||
| if foo: | ||
| class Nested1: | ||
| pass | ||
| class Nested2: | ||
| pass | ||
| # comment | ||
| elif bar: | ||
| class Nested1: | ||
| pass | ||
| # comment | ||
| else: | ||
| pass | ||
|
|
||
| if top1: | ||
| class Nested: | ||
| pass | ||
| if top2: | ||
| pass | ||
|
|
||
| if top1: | ||
| class Nested: | ||
| pass | ||
| # comment | ||
| if top2: | ||
| pass | ||
|
|
||
| if top1: | ||
| class Nested: | ||
| pass | ||
| # comment | ||
| if top2: | ||
| pass | ||
|
|
||
| try: | ||
| class Try: | ||
| pass | ||
| except: | ||
| class Except: | ||
| pass | ||
| foo = 1 | ||
|
|
||
| match foo: | ||
| case 1: | ||
| class Nested: | ||
| pass | ||
| case 2: | ||
| class Nested: | ||
| pass | ||
| case _: | ||
| class Nested: | ||
| pass | ||
| foo = 1 | ||
|
|
||
| class Eof: | ||
| class Nested: | ||
| pass |
6 changes: 6 additions & 0 deletions
6
...sources/test/fixtures/ruff/stub_files/blank_line_after_nested_stub_class_eof.options.json
This file contains hidden or 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,6 @@ | ||
| [ | ||
| { | ||
| "source_type": "Stub", | ||
| "preview": "enabled" | ||
| } | ||
| ] |
17 changes: 17 additions & 0 deletions
17
...matter/resources/test/fixtures/ruff/stub_files/blank_line_after_nested_stub_class_eof.pyi
This file contains hidden or 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,17 @@ | ||
| # A separate file to test out the behavior when there are a mix of blank lines | ||
| # and comments at EOF just after a nested stub class. | ||
|
|
||
| class Top: | ||
| class Nested1: | ||
| class Nested12: | ||
| pass | ||
| # comment | ||
| class Nested2: | ||
| pass | ||
|
|
||
|
|
||
|
|
||
| # comment | ||
|
|
||
|
|
||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.