MNT: replace flake8 + isort with ruff#270
Draft
ZLLentz wants to merge 1 commit intopcdshub:masterfrom
Draft
Conversation
Merged
Contributor
|
How does this work when people submit code that does not conform to style guidelines? (as in, the submitter did not run pre-commit locally) Ruff might format stuff in the CI runner, but we don't have a way to translate that back into commits right? As long as ruff throws an error in the pre-commit job when it fixes things the workflow is the same, but if it fixes things up silently we'll have to adjust our jobs to let the submitter know there are changes to be made. |
Member
Author
|
All pre-commit tasks, ruff format included, have a nonzero return code when they edit files. So, it will cause the job to fail and the diff will appear in the output. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I'm putting this up for consideration because I find this tool very helpful.
Replace the flake8 pre-commit with ruff, using the config I've been using.
The settings are negotiable (comparing with the existing .flake8 config file, maybe there are more changes to make here before merging)
Motivation and Context
flake8 doesn't fix things for you
isort is slow
ruff is fast and fixes things for you
How Has This Been Tested?
This is the config I've been using in other projects
Where Has This Been Documented?
n/a