-
Notifications
You must be signed in to change notification settings - Fork 96
try enabling ruff in pre-commit #2142
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
base: main
Are you sure you want to change the base?
Conversation
No, let's stay with black please. |
Why do you prefer to use black? Ruff is a drop-in replacement but faster. |
I'm all for material performance gains. But black vs. ruff saves a fraction of the 35 seconds all tests in precommit take, usually run in parallel to other stuff. It's just not worth changing. Things like #2077 and #1874 and if we can disable tests #2144 will be much more impactful. I'm sure there is no shortage of other opportunities. |
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.
Let's do it for the better good.
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
55deff1
to
8c08883
Compare
Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
f8e06fc
to
aba23a7
Compare
for more information, see https://pre-commit.ci
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.11.11 | ||
hooks: | ||
- id: black | ||
name: Black code | ||
exclude: "examples" | ||
- id: ruff-check | ||
args: ["--fix"] | ||
- id: ruff-format | ||
types_or: [python, pyi] |
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.
'Let''s split the PR to adding Ruff as flake8 and formatting, so the change is easier to trace/review
What does this PR do?
Enabling
ruff
in pre-commit.Currently only black is used but
lightning-thunder/thunder/dynamo/utils.py
Line 850 in d0f6474
ruff
if it's available.