-
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
Update pre-commit documentation #8545
Conversation
fa5898c
to
cea3c8c
Compare
docs/integrations.md
Outdated
require reformatting. | ||
Ruff's lint hook should be placed run _before_ Ruff's formatter hook, as well as _before_ Black, | ||
isort, and other formatting tools, as Ruff's fix behavior can output code changes that require | ||
reformatting. |
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.
@zanieb -- I'm a little nervous about this change, is there any scenario in which this would be wrong?
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.
Well.. if you're using format rules? Like E501
would have false positives if you ran it before Black.
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.
But wouldn't Black then cause file changes, which would require you to re-run pre-commit? Or are there modes where people run pre-commit with allowed changes?
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.
Ruff would fail first, Black wouldn't run.
cea3c8c
to
3cf712b
Compare
#8567 adds auto-update of these versions |
I got some feedback on Mastodon that it wasn't clear how to use the linter and formatter together in pre-commit (mostly in the pre-commit repo's documentation, which is even less clear, but the two should be consistent).