-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Replace black and blackdoc with ruff-format #9506
Changes from all commits
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,20 +15,15 @@ repos: | |
# Ruff version. | ||
rev: 'v0.6.9' | ||
hooks: | ||
- id: ruff-format | ||
- id: ruff | ||
args: ["--fix", "--show-fixes"] | ||
# https://github.com/python/black#version-control-integration | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 24.8.0 | ||
hooks: | ||
- id: black-jupyter | ||
- repo: https://github.com/keewis/blackdoc | ||
rev: v0.3.9 | ||
hooks: | ||
- id: blackdoc | ||
exclude: "generate_aggregations.py" | ||
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 should probably add the generation scripts as exceptions to ruff as well (in the pyproject.toml?) |
||
additional_dependencies: ["black==24.8.0"] | ||
- id: blackdoc-autoupdate-black | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.11.2 | ||
hooks: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ channels: | |
- conda-forge | ||
- nodefaults | ||
dependencies: | ||
- black | ||
- aiobotocore | ||
- array-api-strict | ||
- boto3 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,7 +233,7 @@ extend-exclude = [ | |
|
||
[tool.ruff.lint] | ||
# E402: module level import not at top of file | ||
# E501: line too long - let black worry about that | ||
# E501: line too long - let the formatter worry about that | ||
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. Maybe this is obsolete when using ruff as a formatter as well? 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. It is not, ruff emits these warnings too |
||
# E731: do not assign a lambda expression, use a def | ||
extend-safe-fixes = [ | ||
"TID252", # absolute imports | ||
|
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.
Is there something similar to Jupyter formatting in ruff as well?
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 think that can be done using
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 think it is done by default: https://docs.astral.sh/ruff/configuration/#jupyter-notebook-discovery