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
Have ruff apply to securedrop/scripts/ too #6932
Conversation
This shouldn't be necessary, running |
I edited the commit message to fix the issue. I kept the precommit hook commit, but I think it should be dropped or needs more detail on what went wrong. |
Oh - iirc it was trying to lint the |
I'm also mildly confused-- reverting to 3f4353e (so no changes to the pre-commit hook) also works just fine for me, and |
The error is only triggered if there's a change in
It's happening because the hook only checks anything if there is a match for |
Thanks for the details:
This is the real problem IMO because it means that even |
@zenmonkeykstop what's the output of |
(I'm not kev, but I am chiming in to say that |
I'm so dumb - the failure comes from the |
9ffa582
to
beb118d
Compare
(Ready for re-review) |
.githooks/pre-commit
Outdated
@@ -14,7 +14,7 @@ if [[ -n "$PY_FILES" ]]; then | |||
echo "$PY_FILES" | |||
# Run black against changed python files for this commit | |||
black --check --diff ${PY_FILES//$'\n'/ } | |||
# Run ruff (against all files, it's fast enough) | |||
# Run ruff against changed python files |
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 comment should be left as it was originally
These need explicit mentioning since they don't have a `.py` extension. The E402 error now applies to the imports following the sys.path.append() call, so move them around.
The relative path causes an issue on some systems. Fixes #6930.
beb118d
to
e9b10f7
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.
LGTM! (can't approve my own PR)
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.
also LGTM
Status
Ready for review
Description of Changes
These need explicit mentioning since they don't have a
.py
extension.The E402 error now applies to the imports following the sys.path.append() call, so move them around.
KOG Update:
make typelint
fails locally due to path interpolation #6930 asmake lint
was failing locally.py
files, as ruff got indigestion trying to lint a bash script.Testing
Checklist
make lint
) and tests (make test
) pass in the development container