Skip to content

chore: add pre-commit config mirroring the CI lint job - #85

Draft
aryansk wants to merge 2 commits into
shauryagangrade:mainfrom
aryansk:chore/pre-commit-config
Draft

chore: add pre-commit config mirroring the CI lint job#85
aryansk wants to merge 2 commits into
shauryagangrade:mainfrom
aryansk:chore/pre-commit-config

Conversation

@aryansk

@aryansk aryansk commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Closes #58.

Problem

CI enforces ruff lint/format and mypy, but there was no local hook, so contributors only learned about violations after pushing (each CI run ~1–2 min).

Change

  • .pre-commit-config.yaml: three repo: local hooks that run the exact CI commands (uv run ruff check ., uv run ruff format --check ., uv run mypy gcode) so there is no version drift between local and CI.
  • pyproject.toml: added pre-commit>=4.0 to the dev extras.
  • CONTRIBUTING.md: new "Pre-commit Hooks" section documenting uv run pre-commit install and uv run pre-commit run --all-files.

Acceptance criteria

  • pre-commit run --all-files passes on a clean tree — verified locally: ruff check, ruff format, and mypy all Passed (pre-commit 4.6.2).
  • CONTRIBUTING mentions the one-line install.

Validation

  • uv run pre-commit run --all-files → all hooks Passed.
  • git diff --check clean.

The test job already runs coverage and uploads .coverage artifacts, but no
one aggregates or publishes the numbers. Emit coverage.xml in the test job
and upload it with codecov/codecov-action (fail_ci_if_error: false so CI
stays green until the Codecov token or app is configured), gitignore the
generated file, and add the Codecov badge to the README next to the build
badge. Fixes shauryagangrade#64.
CI enforces ruff check/format and mypy, but there was no local hook, so
contributors only learned about violations after pushing. Add a
.pre-commit-config.yaml with local hooks that run the exact CI commands
(uv run ruff check ., uv run ruff format --check ., uv run mypy gcode),
add pre-commit to the dev extras, and document the one-line install in
CONTRIBUTING. Fixes shauryagangrade#58.
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.

[DevOps]: Add pre-commit config mirroring CI checks

1 participant