-
Notifications
You must be signed in to change notification settings - Fork 66
Add and prefer the ruff-check
pre-commit ID
#124
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
Conversation
name: ruff | ||
description: "Run 'ruff' for extremely fast Python linting" | ||
- id: ruff-check | ||
name: ruff check |
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.
Change the display name to reflect the sub-command executed.
description: "Run 'ruff' for extremely fast Python linting" | ||
- id: ruff-check | ||
name: ruff check | ||
description: "Run 'ruff check' for extremely fast Python linting" |
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.
Correct a likely oversight from #32
# Legacy alias | ||
- id: ruff | ||
name: ruff (legacy alias) |
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.
Retain the id: ruff
hook ID as an alias. I've changed the name to display ruff (legacy alias)
, but this might be too aggressive for now -- would welcome thoughts.
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.
Thanks! This all looks reasonable to me, including the alias. I'd like to get @dhruvmanila's thoughts too, though, since I'm not that familiar with our pre-commit infrastructure.
Have you tested this locally? It looks like we don't really have any tests set up in CI here.
I believe you can use It seemed to work alright for me! A |
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.
Thanks, this looks good. Sorry, it slipped from my notification somehow.
Thank you @dhruvmanila! A |
## Summary Update pre-commit hook id according to astral-sh/ruff-pre-commit#124
## Summary A couple of months ago now (astral-sh/ruff-pre-commit#124) we changed the hook ID from just `ruff` to `ruff-check` to mirror `ruff-format`. I noticed the `ruff (legacy alias)` when running pre-commit on the release today and realized we should probably update. ## Test Plan Commit on this PR: ```shell > git commit -m "Update pre-commit hook name" check for merge conflicts................................................Passed Validate pyproject.toml..............................(no files to check)Skipped mdformat.............................................(no files to check)Skipped markdownlint-fix.....................................(no files to check)Skipped blacken-docs.........................................(no files to check)Skipped typos....................................................................Passed cargo fmt............................................(no files to check)Skipped ruff format..........................................(no files to check)Skipped ruff check...........................................(no files to check)Skipped <-- prettier.................................................................Passed zizmor...............................................(no files to check)Skipped Validate GitHub Workflows............................(no files to check)Skipped shellcheck...........................................(no files to check)Skipped ``` Compared to the release branch: ```shell > pre-commit run ... cargo fmt............................................(no files to check)Skipped ruff format..........................................(no files to check)Skipped ruff (legacy alias)..................................(no files to check)Skipped ... ```
## Summary A couple of months ago now (astral-sh/ruff-pre-commit#124) we changed the hook ID from just `ruff` to `ruff-check` to mirror `ruff-format`. I noticed the `ruff (legacy alias)` when running pre-commit on the release today and realized we should probably update. ## Test Plan Commit on this PR: ```shell > git commit -m "Update pre-commit hook name" check for merge conflicts................................................Passed Validate pyproject.toml..............................(no files to check)Skipped mdformat.............................................(no files to check)Skipped markdownlint-fix.....................................(no files to check)Skipped blacken-docs.........................................(no files to check)Skipped typos....................................................................Passed cargo fmt............................................(no files to check)Skipped ruff format..........................................(no files to check)Skipped ruff check...........................................(no files to check)Skipped <-- prettier.................................................................Passed zizmor...............................................(no files to check)Skipped Validate GitHub Workflows............................(no files to check)Skipped shellcheck...........................................(no files to check)Skipped ``` Compared to the release branch: ```shell > pre-commit run ... cargo fmt............................................(no files to check)Skipped ruff format..........................................(no files to check)Skipped ruff (legacy alias)..................................(no files to check)Skipped ... ```
Summary
Towards #123. Introduces the
ruff-check
pre-commit hook ID, updates documentation to prefer it, but retains theruff
ID for compatibility.cc @dhruvmanila @zanieb
A