-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use Ruff, fix various tests #92
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5d75512
Use Ruff, fix various tests
JelleZijlstra 34a1e7f
Goodbye 3.7
JelleZijlstra 5be0cbe
need to continue
JelleZijlstra c93d1c8
Thanks Alex
JelleZijlstra 900248a
Add RUF rules
JelleZijlstra 083f33a
Deprecate get_search_path
JelleZijlstra 032921e
Preemptively disable UP038
JelleZijlstra 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,32 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.2.1 | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.1.1 | ||
rev: 24.2.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.9 | ||
|
||
ci: | ||
autofix_commit_msg: '[pre-commit.ci] auto fixes from pre-commit.com hooks' | ||
autofix_prs: true | ||
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' | ||
autoupdate_schedule: weekly | ||
skip: [] | ||
submodules: false | ||
language_version: python3.12 | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
- types-requests | ||
- aiohttp | ||
exclude: ^(typeshed_client/typeshed|tests/(site-packages|typeshed))/ | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v4.0.0-alpha.8 | ||
hooks: | ||
- id: prettier | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace |
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
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 |
---|---|---|
@@ -1,46 +1,41 @@ | ||
"""Package for retrieving data from typeshed.""" | ||
|
||
from . import finder | ||
from . import parser | ||
from . import resolver | ||
|
||
# Exported names | ||
from .finder import ( | ||
get_stub_ast, | ||
get_stub_file, | ||
ModulePath, | ||
SearchContext, | ||
get_all_stub_files, | ||
get_search_context, | ||
SearchContext, | ||
ModulePath, | ||
get_stub_ast, | ||
get_stub_file, | ||
) | ||
from .parser import ( | ||
get_stub_names, | ||
parse_ast, | ||
ImportedName, | ||
NameDict, | ||
NameInfo, | ||
OverloadedName, | ||
get_stub_names, | ||
parse_ast, | ||
) | ||
from .resolver import ImportedInfo, Resolver | ||
|
||
|
||
__version__ = "2.4.0" | ||
|
||
|
||
__all__ = [ | ||
"__version__", | ||
"get_stub_ast", | ||
"get_stub_file", | ||
"get_all_stub_files", | ||
"get_search_context", | ||
"SearchContext", | ||
"ModulePath", | ||
"get_stub_names", | ||
"parse_ast", | ||
"ImportedInfo", | ||
"ImportedName", | ||
"ModulePath", | ||
"NameDict", | ||
"NameInfo", | ||
"OverloadedName", | ||
"ImportedInfo", | ||
"Resolver", | ||
"SearchContext", | ||
"__version__", | ||
"get_all_stub_files", | ||
"get_search_context", | ||
"get_stub_ast", | ||
"get_stub_file", | ||
"get_stub_names", | ||
"parse_ast", | ||
] |
Oops, something went wrong.
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 always ignore
UP038
because of astral-sh/ruff#7871, though it doesn't make much of a difference here since the rule only does things if your lowest supported version is Python 3.10There 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.
Yeah I agree with you there, adding support for
isinstance()
with UnionType was a questionable design choice in the first place. I'll add it to the exclude list and see if I still agree in two years' time when 3.9 goes EOL :)