Skip to content

Make minor updates and tweaks to pre-commit setup#1384

Merged
mhucka merged 20 commits into
quantumlib:mainfrom
mhucka:minor-pre-commit-tweaks
Jun 29, 2026
Merged

Make minor updates and tweaks to pre-commit setup#1384
mhucka merged 20 commits into
quantumlib:mainfrom
mhucka:minor-pre-commit-tweaks

Conversation

@mhucka

@mhucka mhucka commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

This makes some minor updates and tweaks to .pre-commit-config.yaml:

  • Define the hook stages that should be installed, which simplifies the installation instructions to just pre-commit install without having to list 3 separate stages

  • Use hadolint-py for the Docker hook instead of the previous hook; this one lets pre-commit automatically install a Python-wrapped installation of the hadolint program and saves the user from having to install hadolint manually.

  • Add config-file-validator hook.

  • Remove the Markdown link checker hook because it took too long to run.

  • Add more common patterns to exclude.

  • Fix up some hooks

  • Update version hashes to latest versions as needed.

  • Change the style of the descriptions printed by pre-commit, to (hopefully) make them more natural.

mhucka added 10 commits June 26, 2026 21:21
Setting `default_install_hook_types` makes it possible to tell people to
simply run `pre-commit  install` for installation, instead of having to
supply the stage arguments.
These are based on experience with our other projects.
This makes it tailored for pytest tests.
This changes the message style so that they (hopefully) read more
naturally.
@mhucka
mhucka marked this pull request as ready for review June 26, 2026 23:11
@mhucka
mhucka requested a review from arettig June 26, 2026 23:11

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the pre-commit configuration (.pre-commit-config.yaml) and documentation (CONTRIBUTING.md) to simplify installation, refine hook names, and add new validation checks. Key changes include configuring default_install_hook_types so that a simple pre-commit install sets up all hooks, updating hook descriptions to be declarative, and adding new hooks like config-file-validator and validate-pyproject. Feedback on these changes highlights portability issues on Windows: specifically, using a local python hook with a bash script entry for shellcheck and overriding the check-jsonschema entry points with bash -c will both fail on Windows environments. The reviewer suggests using the official shellcheck-py hook and removing the unnecessary bash -c overrides to maintain cross-platform compatibility.

Comment thread .pre-commit-config.yaml Outdated
Comment thread .pre-commit-config.yaml
mhucka added 3 commits June 29, 2026 00:08
Gemini Code Assist had a good suggestion in review.
Put the two shell script checks together.
Gemini Code Assist correctly pointed out that the explicit bash command
line is unnecessary.

@arettig arettig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Tested locally and I can confirm the new pre-commit setup installs and runs correctly. One minor nit/question below.

Comment thread .pre-commit-config.yaml Outdated
@mhucka
mhucka enabled auto-merge June 29, 2026 20:13
@mhucka
mhucka added this pull request to the merge queue Jun 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 29, 2026
@mhucka
mhucka added this pull request to the merge queue Jun 29, 2026
Merged via the queue into quantumlib:main with commit f6db4be Jun 29, 2026
23 checks passed
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.

2 participants