8000 Add and prefer the `ruff-check` pre-commit ID by AA-Turner · Pull Request #124 · astral-sh/ruff-pre-commit · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 1 commit into from
May 13, 2025

Conversation

AA-Turner
Copy link
Contributor

Summary

Towards #123. Introduces the ruff-check pre-commit hook ID, updates documentation to prefer it, but retains the ruff ID for compatibility.

cc @dhruvmanila @zanieb

A

name: ruff
description: "Run 'ruff' for extremely fast Python linting"
- id: ruff-check
name: ruff check
Copy link
Contributor Author

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"
Copy link
Contributor Author

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

Comment on lines +23 to +25
# Legacy alias
- id: ruff
name: ruff (legacy alias)
Copy link
Contributor Author

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.

@zanieb zanieb requested review from ntBre and dhruvmanila May 2, 2025 21:05
Copy link
@ntBre ntBre left a 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.

@AA-Turner
Copy link
Contributor Author

I believe you can use pre-commit try-repo to test this PR on your local computer.

It seemed to work alright for me!

A

Copy link
Member
@dhruvmanila dhruvmanila left a 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.

@dhruvmanila dhruvmanila merged commit 39f54b7 into astral-sh:main May 13, 2025
@AA-Turner AA-Turner deleted the id-ruff-check branch May 13, 2025 13:57
@AA-Turner
Copy link
Contributor Author

Thank you @dhruvmanila!

A

mashehu added a commit to mashehu/ruff that referenced this pull request Jun 17, 2025
ntBre pushed a commit to astral-sh/ruff that referenced this pull request Jun 17, 2025
## Summary

Update pre-commit hook id according to
astral-sh/ruff-pre-commit#124
ntBre added a commit to astral-sh/ruff that referenced this pull request Jul 24, 2025
## 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
...
```
AlexWaygood pushed a commit to astral-sh/ruff that referenced this pull request Jul 25, 2025
## 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
...
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0