Update pre-commit hooks to latest versions#34
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's Guide.pre-commit-config.yaml is updated to newer versions of several hooks (pre-commit-hooks, ruff, pyproject-fmt, mypy, pyright) and their arguments are normalized, including switching the Ruff hook id and simplifying type checker arguments. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The
exclude: '__pycache__/'option was dropped from the Ruff hook; if you still want to skip those directories, consider re-adding the exclude (or a more general pattern) to the updated hook configuration. - Switching from
rufftoruff-checkchanges the hook ID; it may be worth confirming this matches the current upstream hook naming and that any tooling or CI references are updated accordingly. - The
additional_dependencies: [.]entry for the Pyright hook was removed; if Pyright previously depended on installing the local package for type information, you may want to confirm that this is no longer necessary or reintroduce it explicitly.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `exclude: '__pycache__/'` option was dropped from the Ruff hook; if you still want to skip those directories, consider re-adding the exclude (or a more general pattern) to the updated hook configuration.
- Switching from `ruff` to `ruff-check` changes the hook ID; it may be worth confirming this matches the current upstream hook naming and that any tooling or CI references are updated accordingly.
- The `additional_dependencies: [.]` entry for the Pyright hook was removed; if Pyright previously depended on installing the local package for type information, you may want to confirm that this is no longer necessary or reintroduce it explicitly.
## Individual Comments
### Comment 1
<location> `.pre-commit-config.yaml:79` </location>
<code_context>
- id: pyright
# Optional: specify files/directories to check, defaults to project root
files: ^(benchmark|tools)/
- additional_dependencies: [.]
# Tell pyright to use the project config
- args: ["--project", "pyproject.toml"]
+ args: ["--project=pyproject.toml"]
</code_context>
<issue_to_address>
**issue (testing):** Dropping `additional_dependencies: [.]` for pyright may cause missing-dependency errors in isolated pre-commit environments.
Without `additional_dependencies: [.]`, pyright in pre-commit will run without your package (and its runtime deps) installed in the hook venv. In clean CI runs this can surface as false unresolved-import or missing-type issues. If you still want pyright to reflect the real runtime environment, keep `additional_dependencies: [.]` or specify a minimal set of required deps instead.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
(cherry picked from commit 1810985)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates several dependencies and configurations in the
.pre-commit-config.yamlfile to ensure the project uses the latest versions of linting and formatting tools, as well as to improve consistency in argument formatting.Dependency version upgrades:
pre-commit-hooksfromv5.0.0tov6.0.0for the latest pre-commit checks.ruff-pre-commitfromv0.12.1tov0.14.11and switched the linter hook fromrufftoruff-checkfor improved linting and formatting.pyproject-fmtfromv2.6.0tov2.11.1for updated formatting capabilities.mypyfromv1.16.1tov1.19.1and improved argument formatting for better type checking.pyright-pythonfromv1.1.402tov1.1.408and updated the argument format for project configuration.@ternaus I think that the pre-commit bot is not installed/enabled for this repo since, according to the config, it shall generate weekly updates, but none ever happen...
Summary by Sourcery
Update pre-commit configuration to use newer tooling versions and align hook arguments with current conventions.
Build:
CI: