Skip to content

ci: add pre-commit hooks mirroring make quality - #863

Open
orestis-z wants to merge 1 commit into
mainfrom
add-pre-commit-hooks
Open

ci: add pre-commit hooks mirroring make quality#863
orestis-z wants to merge 1 commit into
mainfrom
add-pre-commit-hooks

Conversation

@orestis-z

Copy link
Copy Markdown
Collaborator

Adds pre-commit hooks that mirror the checks in make quality, so contributors catch issues locally before CI runs them. Modeled on vllm-project/speculators#1044, adapted to this repo's tooling.

What runs

The hooks mirror make quality, each scoped to the same paths that target uses:

  • black (--target-version py310), isort, flake8 — scoped to PYCHECKDIRS (src tests).
  • copyrightutils/copyright.py quality, scoped to PYCHECKGLOBS (src tests utils examples setup.py).
  • lint-cudatools/lint_cuda.py --fail-on-issues, scoped to src tests.
  • signoff-commit — a commit-msg hook that appends a DCO Signed-off-by trailer if missing, matching the git commit -s requirement.

The formatters/linters run as local system hooks (rather than pinned remote mirrors) so they use the exact versions from the [dev] extra and the config in setup.cfg. This also sidesteps a build failure when installing the old isort==5.8.0 pre-commit mirror. Scoping with files: matters here — e.g. setup.py is intentionally excluded from black/isort/flake8 in make quality, so it stays excluded.

Also

  • Add pre-commit>=4.0.0 to the [dev] extra.
  • Document the hooks in a new Development section of the README (this repo has no CONTRIBUTING.md).

Usage

pip install -e .[dev]
pre-commit install

Opened as a draft for review of the approach.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 936905bf-0e51-4d9f-ad73-12ee62ed7cfb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify mergify Bot added the documentation Improvements or additions to documentation label Sep 1, 2026
@mergify

mergify Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Require one maintainer review

All PRs must have at least one approving review from a maintainer before merging.

  • #changes-requested-reviews-by = 0
  • any of:
    • approved-reviews-by=brian-dellabetta
    • approved-reviews-by=HDCharles
    • approved-reviews-by=dsikka
    • approved-reviews-by=kylesayrs

@orestis-z orestis-z self-assigned this Sep 1, 2026
@orestis-z
orestis-z marked this pull request as ready for review September 1, 2026 13:23
Add a .pre-commit-config.yaml whose hooks mirror the checks run by
`make quality` (copyright headers, black, isort, flake8, and
tools/lint_cuda.py), each scoped to the same paths that target uses
(PYCHECKDIRS / PYCHECKGLOBS), plus a DCO sign-off commit-msg hook. This
catches issues locally before CI runs them.

The formatters/linters run as local system hooks so they use the exact
versions pinned in the [dev] extra and the config in setup.cfg. Pin
pre-commit in [dev] and document usage in the README.

Signed-off-by: Orestis Zambounis <23146389+orestis-z@users.noreply.github.com>
@orestis-z
orestis-z force-pushed the add-pre-commit-hooks branch from e17425a to e39f924 Compare September 1, 2026 13:31

@brian-dellabetta brian-dellabetta left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @orestis-z ! Can we land this to try it out before landing the llm-compressor one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants