-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
STYLE ignore no-else-* checks, + assorted cleanups #49750
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
10 commits
Select commit
Hold shift + click to select a range
04a1eeb
ignore no-else-*, comment some checks as intentionally turned off, sh…
93b5793
add redefined-outer-name check, but turn off in remaining files
6ec1012
keep redefined-outer-name to manual stage
e238fbb
Merge remote-tracking branch 'upstream/main' into no-else
312d64f
update exclude list
156ef11
reword
038a7e8
Merge remote-tracking branch 'upstream/main' into no-else
18f935e
Merge remote-tracking branch 'upstream/main' into no-else
255317a
fixup after merge
157ac22
fixup again
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 |
---|---|---|
|
@@ -37,8 +37,8 @@ jobs: | |
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
typing_and_docstring_validation: | ||
name: Docstring and typing validation | ||
docstring_typing_pylint: | ||
name: Docstring validation, typing, and pylint | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
|
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 |
---|---|---|
|
@@ -64,6 +64,25 @@ repos: | |
hooks: | ||
- id: pylint | ||
stages: [manual] | ||
- repo: https://github.com/pycqa/pylint | ||
rev: v2.15.5 | ||
hooks: | ||
- id: pylint | ||
alias: redefined-outer-name | ||
name: Redefining name from outer scope | ||
files: ^pandas/ | ||
exclude: | | ||
(?x) | ||
^pandas/tests # keep excluded | ||
|/_testing/ # keep excluded | ||
|^pandas/util/_test_decorators\.py # keep excluded | ||
|^pandas/_version\.py # keep excluded | ||
|^pandas/conftest\.py # keep excluded | ||
|^pandas/core/tools/datetimes\.py | ||
|^pandas/io/formats/format\.py | ||
|^pandas/core/generic\.py | ||
args: [--disable=all, --enable=redefined-outer-name] | ||
stages: [manual] | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
|
@@ -201,7 +220,7 @@ repos: | |
entry: python scripts/sync_flake8_versions.py | ||
files: ^(\.pre-commit-config\.yaml|environment\.yml)$ | ||
pass_filenames: false | ||
additional_dependencies: [pyyaml] | ||
additional_dependencies: [pyyaml, toml] | ||
Comment on lines
-204
to
+223
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is unrelated to the pylint changes, but it's really minor so doing it while I'm here The local hook just above has
, so this one might as well take |
||
- id: title-capitalization | ||
name: Validate correct capitalization among titles in documentation | ||
entry: python scripts/validate_rst_title_capitalization.py | ||
|
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.
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.
What's the idea of adding this one that only runs a specific check if we already have a pylint one for all checks above? (since both are labeled as "manual" stage)
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.
this one can't be applied to all files, it has lots of false positives in tests because of fixtures
but, like this, we can turn it on for the non-test files
unfortunately pylint doesn't have a per-file-excludes option like flake8 does
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.
Ah, OK, thanks for the explanation!