-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
chore: modernize Ruff config #148
Conversation
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@@ -39,7 +35,8 @@ repos: | |||
rev: v0.1.3 | |||
hooks: | |||
- id: ruff | |||
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes] | |||
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes, --show-fixes] | |||
- 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.
Shouldn't the format be before the lint?
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.
The formatter is guaranteed to not add new violations (if not, it's a bug and can be reported), while the linter is not guaranteed to not mess up the format. This is the official recommendation for now, eventually there might be a more elegant solution.
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 if I run the linter, and the format; wouldn't it mean my linter reports will get reported with bad lines?
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.
That’s why there will be a better solution in the future. I assume it likely will have to be a way to run both at once. (But that’s a guess)
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.
pyproject.toml
Outdated
[tool.ruff.lint] | ||
select = ["ALL"] | ||
isort.required-imports = ["from __future__ import annotations"] |
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.
I strongly prefer to inline things rather than define new tables.
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.
Okay.
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.
I wasn't sure, per-file-ignores is a separate table already.
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
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.
Modernizing the Ruff config a bit. More things are in a .lint namespace now.