-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Replace Flake8 checks with Ruff (except for flake8-pyi) #11496
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 all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
1f898d0
Configuration updates
Avasam 6046354
noqa comments fixes
Avasam ec9bfbd
Code improvements from new Ruff checks
Avasam c459fa5
noqa comments updates
Avasam ff0f3af
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f03df93
Missed an instance of flake8-bugbear
Avasam ddbb10b
Merge branch 'go-ruff' of https://github.com/Avasam/typeshed into go-…
Avasam 51d8dd0
typo
Avasam 85075f1
Add pyupgrade check outdated-version-block (UP036)
Avasam f8249d7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ccf8d46
Also apply to google/protobuf
Avasam f95f0c5
s2clientprotocol
Avasam 10bae4f
Safer script change
Avasam d432e5c
Apply suggestions from code review
Avasam eb3394d
Merge branch 'main' into outdated-version-block-(UP036)
AlexWaygood 6e67457
Merge branch 'outdated-version-block-(UP036)' of https://github.com/A…
Avasam c3beff2
Merge branch 'go-ruff' of https://github.com/Avasam/typeshed into go-…
Avasam 32f597e
Update stdlib/builtins.pyi
Avasam 4b11ccd
Merge branch 'main' into go-ruff
AlexWaygood a3b0e69
Updated local ruff and re-run
Avasam e976d26
Merge branch 'main' into go-ruff
Avasam b916e81
Add RUF100 (unused-noqa) to test_cases
Avasam 532ba40
Post-merge fixes
Avasam 1066021
Update pyproject.toml
Avasam e03f0fd
Use select instead of extend-select
Avasam 86614e5
Merge branch 'go-ruff' of https://github.com/Avasam/typeshed into go-…
Avasam ddccce3
Improve comments
Avasam 4530a0b
Update pyproject.toml
Avasam edb99b7
Merge branch 'main' into go-ruff
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,19 @@ | ||
| # The following rules come from plugins that are not used by typeshed. | ||
| # Since typeshed stubs them, they can still be expected to be found in a | ||
| # developer's venv for intellisense and reference reasons | ||
| # A flake8-builtins | ||
| # B flake8-bugbear | ||
| # D flake8-docstrings | ||
| # N8 pep8-naming | ||
| # SIM flake8-simplify | ||
| # RST flake8-rst-docstrings | ||
| # TYP flake8-typing-imports | ||
|
|
||
| # The following rules are incompatible with or enforced by Black: | ||
| # E203 whitespace before ':' -- scripts only | ||
| # E301 expected 1 blank line | ||
| # E302 expected 2 blank lines | ||
| # E305 expected 2 blank lines | ||
| # E501 line too long | ||
| # E701 Multiple statements on one line (colon) -- disallows "..." on the same line | ||
|
|
||
| # Some rules are considered irrelevant to stub files: | ||
| # F401 imported but unused -- does not recognize re-exports | ||
| # https://github.com/PyCQA/pyflakes/issues/474 | ||
|
|
||
| # Rules that are out of the control of stub authors: | ||
| # E741 ambiguous variable name | ||
| # F403 import *' used; unable to detect undefined names | ||
| # F405 defined from star imports | ||
|
|
||
| [flake8] | ||
| extend-ignore = A, B, D, N8, SIM, RST, TYP, E301, E302, E305, E501, E701 | ||
| # NQA: Ruff won't warn about redundant `# noqa: Y` | ||
| # Y: Flake8 is only used to run flake8-pyi, everything else is in Ruff | ||
| # F821: Until https://github.com/astral-sh/ruff/issues/3011 is fixed, we need flake8-pyi's monkeypatching | ||
| select = NQA, Y, F821 | ||
| # Ignore rules normally excluded by default | ||
| extend-ignore = Y090 | ||
| per-file-ignores = | ||
| *.py: E203 | ||
| *.pyi: E741, F401, F403, F405 | ||
| # Since typing.pyi defines "overload" this is not recognized by Flake8 as typing.overload. | ||
| # Unfortunately, Flake8 does not allow to "noqa" just a specific error inside the file itself. | ||
| # https://github.com/PyCQA/flake8/issues/1079 | ||
| # F811 redefinition of unused '...' | ||
| stdlib/typing.pyi: E741, F401, F403, F405, F811 | ||
| # Generated protobuf files include docstrings, | ||
| # and import some things from typing_extensions that could be imported from typing | ||
| *_pb2.pyi: E741, F401, F403, F405, Y021, Y023, Y026, Y053, Y054 | ||
| # We should only need to noqa Y and F821 codes in .pyi files | ||
| *.py: NQA | ||
| # Generated protobuf files: | ||
| # Y021: Include docstrings | ||
| # Y023: Alias typing as typing_extensions | ||
| # Y026: Have implicit type aliases | ||
| # Y053: have literals >50 characters long | ||
| *_pb2.pyi: Y021, Y023, Y026, Y053 | ||
|
|
||
| exclude = .venv*,.git | ||
| noqa_require_code = true |
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
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
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.