-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Improve formatting of @overload-decorated function groups in stub files, especially those with docstrings
#5021
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 14 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
28034ee
Add preview feature for consistent blank lines around overload groups…
AlexWaygood d7c4c6c
Broaden overload group heuristic to apply regardless of adjacent stat…
AlexWaygood afdc650
docs
AlexWaygood 1280c7a
format
AlexWaygood 1df33b6
.
AlexWaygood 32392c7
schema
AlexWaygood 9540cbc
Merge branch 'better-stub-formatting-2' of https://github.com/AlexWay…
AlexWaygood 29f31bd
improve docs
AlexWaygood c40e0cb
Address review to limit the changes to only groups of >=1 same-named …
AlexWaygood 71f6243
fixup docs per review
AlexWaygood f88aeb2
revert change to `test_black.py`
AlexWaygood 50072ba
factor out a helper method and fix edge cases involving comments in b…
AlexWaygood a86506b
format
AlexWaygood b3ad971
refactor helpers and add tests for comments near overload groups
AlexWaygood 15809a2
fix bug highlighted by diff-shades
AlexWaygood add21ae
fix edge cases: 3+ stub overloads, blank lines around if/else blocks
AlexWaygood b4277b7
nits
AlexWaygood 43fd521
simplifications
AlexWaygood a823c88
Merge branch 'main' into better-stub-formatting-2
AlexWaygood ae32bed
.
AlexWaygood 3f976c6
.
AlexWaygood 8ed13f5
simplifications and more tests
AlexWaygood 9e23f32
Merge branch 'better-stub-formatting-2' of https://github.com/AlexWay…
AlexWaygood 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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd normally use a set for this kind of containment check, but IIRC mypyc optimizes tuples much better than sets (though maybe that's outdated lore by now...? Not sure...), and I know black compiles with mypyc