-
Notifications
You must be signed in to change notification settings - Fork 55
Add Ruff formatter to pre-commit for Python #1852
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
base: dev
Are you sure you want to change the base?
Changes from all commits
278af64
62188fc
f41d5a3
f4c6dfa
c0fcf1b
0f90c55
3853f9c
0c287fe
eb0ec4f
3d8ba99
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 |
|---|---|---|
|
|
@@ -85,13 +85,20 @@ repos: | |
| - id: pycln | ||
| name: pycln (python) | ||
|
|
||
| # Sorts Python imports according to PEP8 | ||
| # https://www.python.org/dev/peps/pep-0008/#imports | ||
| - repo: https://github.com/pycqa/isort | ||
| rev: 7.0.0 | ||
| # # Sorts Python imports according to PEP8 | ||
| # # https://www.python.org/dev/peps/pep-0008/#imports | ||
| # - repo: https://github.com/pycqa/isort | ||
| # rev: 7.0.0 | ||
| # hooks: | ||
| # - id: isort | ||
| # name: isort (python) | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.1 | ||
| hooks: | ||
| - id: isort | ||
| name: isort (python) | ||
| - id: ruff-check | ||
| args: [ --fix, --exit-non-zero-on-fix ] | ||
| - id: ruff-format | ||
|
Comment on lines
+96
to
+101
Member
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. We could add a few more flags for the linter: Then move options like That way, local runs of ruff linter (outside of pre-commit) will have the same configs.
Contributor
Author
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. Ruff apparently also looks for configuration directly inside |
||
|
|
||
| # Python: Flake8 (checks only, does this support auto-fixes?) | ||
| #- repo: https://github.com/PyCQA/flake8 | ||
|
|
||
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.
Yes this one we remove, replaced by ruff