-
Notifications
You must be signed in to change notification settings - Fork 454
Use ruff for formatting #1275
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: main
Are you sure you want to change the base?
Use ruff for formatting #1275
Conversation
'--skip-string-normalization'] | ||
- id: ruff | ||
args: [--fix] | ||
- id: ruff-format |
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.
We still need to enforce the line length of 125
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.
It's in pyproject.toml
now
'--extend-ignore=E203,T201'] # E203 is not PEP8 compliant | ||
'--extend-ignore=E203,T201,F401'] | ||
# E203 is not PEP8 compliant | ||
# F401 included in ruff (behaves slightly differently for noqa flags) |
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 F401 ignored everywhere? If so, I think it's a bad idea.
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.
F401 included in ruff, see pyproject.toml
. Only ignored for __init__.py
.
Description
While the current codebase favors single quote strings, black cannot enforce that (only otherwise around). This PR replaces black by ruff which can enforce single quote for one-line strings, and double quote for docstring/other multiline string.
Other formatting behavior also changes, mainly assert no longer breaks at the strange location, multiple imports from the same location will be merged automatically, etc.
This PR will introduce major merge conflicts if added as-is.
isort's functionality is covered thus removed. flake8 doesn't seem to be really necessary but is kept just in case.
Type of change