-
Notifications
You must be signed in to change notification settings - Fork 441
Replace Black with Ruff #740
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
Conversation
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.
What's the rationale for this change? How about explaining this in the commit message? Thanks!
The linked ticket has a long explanation why it's a good idea to move to Ruff. Do you want me to replicate the information into the commit message? |
I overlooked the issue 🤦🏻 , thanks for pointing it out. I like to think about commit messages as being self-sufficient but it's a matter of preference. Maybe not replicate everything but a few lines on why is probably worth it. However, I have no authority on this repo so I'll leave it up to you to amend your commit message or not :). Thanks! |
It's all good :) I have updated the comment and configured Ruff's isort to use same settings as |
Thanks! |
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.
LGTM!
I tested this in the fmt
and ruff
tox environments, as well.
Ruff is an extremely fast Python linter and code formatter, written in Rust. It is a fantastic tool that combines the features of flake8 linter, isort, Black code formatter, and (to some degree) pylint in one tool. It comes with over 800 linting rules. Ruff is not only blazing fast, it can also fix most code violation. The code fixer is a fantastic quality of life feature for developers. Gradually introduce Ruff for linting and code formatting. Replaces Black as code formatting tool. Ruff is configured to create the same results as Black's default configuration. Linters will be enabled in future commits. See: #739 Co-authored-by: Miroslav Vadkerti <mvadkert@redhat.com> Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reformat all files with `pre-commit run --all-files` Signed-off-by: Christian Heimes <cheimes@redhat.com>
@russellb I have rebased the PR to solve a merge conflict. One of the reformatted files no longer needed fixing. |
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.
Nice, thank you!
Small changes to docs to fix some spelling issues and to use a consistent emoji for InstructLab. Signed-off-by: BJ Hargrave <hargrave@us.ibm.com>
Description of your changes:
Ruff is an extremely fast Python linter and code formatter, written in Rust. It is a fantastic tool that combines the features of flake8 linter, isort, Black code formatter, and (to some degree) pylint in one tool. It comes with over 800 linting rules. Ruff is not only blazing fast, it can also fix most code violation. The code fixer is a fantastic quality of life feature for developers.
Gradually introduce Ruff for linting and code formatting. Replaces Black as code formatting tool. Ruff is configured to create the same results as Black's default configuration.
Linters will be enabled in future commits.
Co-authored-by: @thrix
Which issue is resolved by this Pull Request:
See #739