Skip to content

Bump pre-commit ruff hook to v0.13.1 to match the quality extra#4089

Open
devangpratap wants to merge 1 commit into
huggingface:mainfrom
devangpratap:chore/bump-precommit-ruff
Open

Bump pre-commit ruff hook to v0.13.1 to match the quality extra#4089
devangpratap wants to merge 1 commit into
huggingface:mainfrom
devangpratap:chore/bump-precommit-ruff

Conversation

@devangpratap

Copy link
Copy Markdown

What does this PR do?

The pre-commit ruff hook is pinned at v0.2.1, which cannot parse the current pyproject.toml: it ignores the UP045 and UP035 rule selectors that ruff 0.2.1 does not recognize. As a result pre-commit run fails on a fresh checkout, before linting any file:

ruff.....................................................................Failed
- hook id: ruff
  Cause: TOML parse error at line 5, column 1
    |
  5 | [tool.ruff.lint]
    | ^^^^^^^^^^^^^^^^
  Unknown rule selector: `UP045`

setup.py already pins extras["quality"] = ["ruff == 0.13.1"], so make quality works while the hooks are broken. This bumps the hook to v0.13.1 to match the version the project targets, so pre-commit passes on a clean checkout.

Verified pre-commit run ruff passes after the bump.

Fixes #4088.

Before submitting

Who can review?

@SunMarc

The pre-commit ruff hook was pinned at v0.2.1, which cannot parse the
current pyproject.toml (it ignores the UP045 and UP035 rule selectors that
0.2.1 does not know), so `pre-commit run` fails on a fresh checkout with
"Unknown rule selector: UP045". setup.py already pins ruff == 0.13.1 for the
quality extra, so this aligns the hook with the version the project targets.

@SunMarc SunMarc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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.

pre-commit fails on a fresh checkout: pinned ruff v0.2.1 can't parse pyproject.toml (Unknown rule selector: UP045)

3 participants