Skip to content

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 dhruvmanila and ntBre 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
...
```
DimitriPapadopoulos added a commit to DimitriPapadopoulos/parsec-cloud that referenced this pull request Aug 8, 2025
Align with the preferred ruff-pre-commit hook name:
	astral-sh/ruff-pre-commit#124
github-merge-queue bot pushed a commit to Scille/parsec-cloud that referenced this pull request Aug 15, 2025
Align with the preferred ruff-pre-commit hook name:
	astral-sh/ruff-pre-commit#124
github-merge-queue bot pushed a commit to Scille/parsec-cloud that referenced this pull request Aug 18, 2025
Align with the preferred ruff-pre-commit hook name:
	astral-sh/ruff-pre-commit#124
cavcrosby pushed a commit to cavcrosby/aws-cm that referenced this pull request Oct 4, 2025
The ruff pre-commit hook has been updated to the ruff-check hook, as the
former is now just an alias for the latter. The GitHub pull request,
astral-sh/ruff-pre-commit#124, discusses these
changes.
cavcrosby pushed a commit to cavcrosby/aws-cm that referenced this pull request Oct 4, 2025
The ruff pre-commit hook has been updated to the ruff-check hook, as the
former is now just an alias for the latter. The GitHub pull request,
astral-sh/ruff-pre-commit#124, discusses these
changes.

The spacing underneath the 5th step in the README.md has changed due to
Prettier's pre-commit hook formatting it.
cavcrosby pushed a commit to cavcrosby/aws-cm that referenced this pull request Oct 8, 2025
The ruff pre-commit hook has been updated to the ruff-check hook, as the
former is now just an alias for the latter. The GitHub pull request,
astral-sh/ruff-pre-commit#124, discusses these
changes.

The spacing underneath the 5th step in the README.md has changed due to
Prettier's pre-commit hook formatting it.
cavcrosby pushed a commit to cavcrosby/homelab-cm that referenced this pull request Oct 11, 2025
The ruff pre-commit hook has been updated to the ruff-check hook, as the
former is now just an alias for the latter. The GitHub pull request,
astral-sh/ruff-pre-commit#124, discusses these
changes.

The spacing underneath many lines within the code.md and
infrastructure.md Markdown files has changed due to Prettier's
pre-commit hook formatting them. Also, many link texts have changed to
satisfy markdownlint's new MD059 rule (link text should be descriptive).

The use_keywords_order_plays.yml playbook has changed to resolve
ansible-lint name[unique] violations.

Many role variables have been changed to resolve ansible-lint
var-naming[no-role-prefix] violations.

Passing the line number for tasks and plays (via 'data') as an argument
to the create_matcherror method has changed due to how this attribute is
to be accessed in relation to future versions of the ansible-core
package (>= 2.19). This conclusion has come from reading
ansible/ansible-lint#4554 and
ansible/ansible-lint#4564.

A version_changed attribute has been added to all rules to suppress a
warning now generated from ansible-lint that complains when this
attribute is missing. This behavior was introduced as of this commit:
ansible/ansible-lint#4431. The value for this
attribute models the one in the pyproject.toml file, in that it is not
intended to hold much significance. This is primarily because I see
little value in updating this attribute over time for internal rules.

The _get_leaf_items method's type hint has changed from the union type
'list[Any] | dict[Any, Any]' to 'list[Any] | Mapping[Any, Any]' because
the parent class type of ansiblelint.utils.Task has changed to be
Mapping[str, Any].

The AnsibleUnicodeItems type alias now uses the 'type' keyword instead
of TypeAlias, as this was recommended per ruff's non-pep695-type-alias
rule.
scop added a commit to scop/bash-completion that referenced this pull request Oct 13, 2025
scop added a commit to scop/bash-completion that referenced this pull request Oct 16, 2025
cavcrosby pushed a commit to cavcrosby/homelab-cm that referenced this pull request Oct 18, 2025
The ruff pre-commit hook has been updated to the ruff-check hook, as the
former is now just an alias for the latter. The GitHub pull request,
astral-sh/ruff-pre-commit#124, discusses these
changes.

The spacing underneath many lines within the code.md and
infrastructure.md Markdown files has changed due to Prettier's
pre-commit hook formatting them. Also, many link texts have changed to
satisfy markdownlint's new MD059 rule (link text should be descriptive).

The use_keywords_order_plays.yml playbook has changed to resolve
ansible-lint name[unique] violations.

Many role variables have been changed to resolve ansible-lint
var-naming[no-role-prefix] violations.

Passing the line number for tasks and plays (via 'data') as an argument
to the create_matcherror method has changed due to how this attribute is
to be accessed in relation to future versions of the ansible-core
package (>= 2.19). This conclusion has come from reading
ansible/ansible-lint#4554 and
ansible/ansible-lint#4564.

A version_changed attribute has been added to all rules to suppress a
warning now generated from ansible-lint that complains when this
attribute is missing. This behavior was introduced as of this commit:
ansible/ansible-lint#4431. The value for this
attribute models the one in the pyproject.toml file, in that it is not
intended to hold much significance. This is primarily because I see
little value in updating this attribute over time for internal rules.

The _get_leaf_items method's type hint has changed from the union type
'list[Any] | dict[Any, Any]' to 'list[Any] | Mapping[Any, Any]' because
the parent class type of ansiblelint.utils.Task has changed to be
Mapping[str, Any].

The AnsibleUnicodeItems type alias now uses the 'type' keyword instead
of TypeAlias, as this was recommended per ruff's non-pep695-type-alias
rule.
miketheman added a commit to miketheman/stave that referenced this pull request Oct 25, 2025
Refs: astral-sh/ruff-pre-commit#124

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
cavcrosby pushed a commit to cavcrosby/aws-cm that referenced this pull request Oct 27, 2025
The ruff pre-commit hook has been updated to the ruff-check hook, as the
former is now just an alias for the latter. The GitHub pull request,
astral-sh/ruff-pre-commit#124, discusses these
changes.

The spacing underneath the 5th step in the README.md has changed due to
Prettier's pre-commit hook formatting it.
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