-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
DEV/STYLE: use ruff for linting #50160
Changes from 7 commits
678252d
dacc803
46cdce3
9aedb84
00b7f37
27963c0
cdebc83
b2223f5
407e962
21495ea
db0cf96
1774eb5
d077ec8
0fa40d8
a5e6c10
bb5d7e5
61437df
2e1a4aa
2aaaa72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,10 @@ default_stages: [ | |
ci: | ||
autofix_prs: false | ||
repos: | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.0.205 | ||
hooks: | ||
- id: ruff | ||
- repo: https://github.com/MarcoGorelli/absolufy-imports | ||
rev: v0.3.1 | ||
hooks: | ||
|
@@ -66,16 +70,6 @@ repos: | |
--linelength=88, | ||
'--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size' | ||
] | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
# Need to patch os.remove rule in pandas-dev-flaker | ||
exclude: ^ci/fix_wheels.py | ||
additional_dependencies: &flake8_dependencies | ||
- flake8==6.0.0 | ||
- flake8-bugbear==22.7.1 | ||
- pandas-dev-flaker==0.5.0 | ||
- repo: https://github.com/pycqa/pylint | ||
rev: v2.15.6 | ||
hooks: | ||
|
@@ -121,12 +115,6 @@ repos: | |
rev: v0.6.7 | ||
hooks: | ||
- id: sphinx-lint | ||
- repo: https://github.com/asottile/yesqa | ||
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.
|
||
rev: v1.4.0 | ||
hooks: | ||
- id: yesqa | ||
additional_dependencies: *flake8_dependencies | ||
stages: [manual] | ||
- repo: local | ||
hooks: | ||
# NOTE: we make `black` a local hook because if it's installed from | ||
|
@@ -239,13 +227,6 @@ repos: | |
files: ^(environment.yml|requirements-dev.txt)$ | ||
pass_filenames: false | ||
additional_dependencies: [pyyaml, toml] | ||
- id: sync-flake8-versions | ||
name: Check flake8 version is synced across flake8, yesqa, and environment.yml | ||
language: python | ||
entry: python scripts/sync_flake8_versions.py | ||
files: ^(\.pre-commit-config\.yaml|environment\.yml)$ | ||
pass_filenames: false | ||
additional_dependencies: [pyyaml, toml] | ||
- id: title-capitalization | ||
name: Validate correct capitalization among titles in documentation | ||
entry: python scripts/validate_rst_title_capitalization.py | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,19 +78,17 @@ dependencies: | |
- black=22.10.0 | ||
- cpplint | ||
- flake8=6.0.0 | ||
- flake8-bugbear=22.7.1 # used by flake8, find likely bugs | ||
- isort>=5.2.1 # check that imports are in the right order | ||
- mypy=0.991 | ||
- pre-commit>=2.15.0 | ||
- pycodestyle # used by flake8 | ||
- pyupgrade | ||
- ruff=0.0.205 | ||
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. Needs to be synced with pre-commit (ideally enforced or comments in both files) 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. Should ruff actually be here? People are supposed to run pre-commit. 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.
I think we don't require people to use pre-commit (only recommend it in our contributing guide). In general the environment seems to contain all tools, it also includes black, isort, etc |
||
|
||
# documentation | ||
- gitpython # obtain contributors from git for whatsnew | ||
- gitdb | ||
- natsort # DataFrame.sort_values doctest | ||
- numpydoc | ||
- pandas-dev-flaker=0.5.0 | ||
- pydata-sphinx-theme<0.11 | ||
- pytest-cython # doctest | ||
- sphinx | ||
|
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.
Completely removing flake8 here means we also stop using pandas-dev-flaker. I am not familiar with it, but are there things we would like to keep from that? Is it possible to run flake8 only with the pandas-dev-flaker checks?
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 looked into that but it's not so simple...I think the simplest thing would be to revert the pandas-dev-flaker PR #50519
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.
OK, I see, that's indeed also a good option.