-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[CI][Linter] Replace flake8
and isort
with ruff
#49435
base: master
Are you sure you want to change the base?
[CI][Linter] Replace flake8
and isort
with ruff
#49435
Conversation
18e5b64
to
18ead33
Compare
flake8
and isort
with ruff
3474ec9
to
aab7d03
Compare
Signed-off-by: Chi-Sheng Liu <[email protected]>
Closes: ray-project#48508 Signed-off-by: Chi-Sheng Liu <[email protected]>
Closes: ray-project#48508 Signed-off-by: Chi-Sheng Liu <[email protected]>
Closes: ray-project#48508 Signed-off-by: Chi-Sheng Liu <[email protected]>
Closes: ray-project#48508 Signed-off-by: Chi-Sheng Liu <[email protected]>
Closes: ray-project#48508 Signed-off-by: Chi-Sheng Liu <[email protected]>
Closes: ray-project#48508 Signed-off-by: Chi-Sheng Liu <[email protected]>
aab7d03
to
2e84c6a
Compare
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.
blazing fast linting ⚡️
hooks: | ||
- id: ruff | ||
args: [ --fix, --exit-non-zero-on-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.
This will be uncommented in the follow-up PR to replace the black
formatter.
# TODO(barakmich): This should be cleaned up. I've at least excised the copies | ||
# of these arguments to this location, but the long-term answer is to actually | ||
# make a flake8 config file | ||
FLAKE8_PYX_IGNORES="--ignore=C408,E121,E123,E126,E211,E225,E226,E227,E24,E704,E999,W503,W504,W605" |
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.
Currently, ruff
does not support Cython.
In fact, flake8
also does not directly support Cython, which is why many rules need to be ignored here. If Cython support is still needed, this can be addressed in a follow-up PR by running ruff
on Cython files, while similarly ignoring many rules.
" image = self.pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]\n", | ||
"\t\treturn image\n", | ||
" return image\n", |
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 fixes IndentationError
.
cool! @aslonnie any comments? |
Lonnie is OOO for a few weeks. @can-anyscale any opposition to this? |
Why are these changes needed?
This PR replaces
flake8
andisort
withruff
.To minimize changes, all rules that cause file modifications are ignored.
Although this PR involves many files, the changes to Python files are limited to modifications of flake8 comments.
The latest version of
ruff
does not support disabling checks forSyntaxError
, sopython/ray/serve/tests/test_config_files/syntax_error.py
is explicitly excluded inpyproject.toml
. See https://docs.astral.sh/ruff/rules/syntax-error/ for details.Follow-up:
black
withruff format
#49436Related issue number
Closes #48508
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.