Skip to content

docs: mention pre-commit in AGENTS.md and CLAUDE.md#99

Merged
dgenio merged 3 commits intomainfrom
copilot/add-pre-commit-config
Mar 4, 2026
Merged

docs: mention pre-commit in AGENTS.md and CLAUDE.md#99
dgenio merged 3 commits intomainfrom
copilot/add-pre-commit-config

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

The pre-commit infrastructure (.pre-commit-config.yaml, dev dependency, CONTRIBUTING.md setup step) was already in place, but agent-facing guides (AGENTS.md, CLAUDE.md) had no mention of it — meaning agents and developers would skip pre-commit install and only catch format/lint failures in CI.

Changes

  • AGENTS.md — Added a note after the Commands section instructing agents to run pre-commit install once after cloning, with a brief description of what the hooks do
  • CLAUDE.md — Added pre-commit install as the first "Do" item so it's the highest-priority setup step Claude sees
Original prompt

This section details on the original issue you should resolve

<issue_title>[infra] Add .pre-commit-config.yaml with ruff format + check hooks</issue_title>
<issue_description>## Problem

The repo has no .pre-commit-config.yaml. Developers and AI agents can commit unformatted or unlinted code, only catching issues after pushing to CI. This wastes CI cycles and slows feedback loops, especially for agent-driven development where agents submit frequent PRs.

Evidence:

  • .pre-commit-config.yaml — missing
  • pyproject.toml [project.optional-dependencies] dev does not include pre-commit
  • CI already runs ruff format --check and ruff check (.github/workflows/ci.yml)
  • CONTRIBUTING.md mentions make fmt / make lint but not pre-commit hooks

Proposal

Add a .pre-commit-config.yaml with ruff-only hooks (format + check). mypy is excluded from pre-commit to keep hooks fast (mypy runs in CI).

Hook configuration

repos:
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.4.x  # pin to version matching pyproject.toml
    hooks:
      - id: ruff-format
      - id: ruff
        args: [--fix]

Supporting changes

  • Add pre-commit to dev dependencies in pyproject.toml
  • Update CONTRIBUTING.md with pre-commit install setup step
  • Mention pre-commit in AGENTS.md and CLAUDE.md

Acceptance criteria

  • .pre-commit-config.yaml created with ruff-format + ruff hooks
  • ruff version pinned to match pyproject.toml (>=0.4)
  • pre-commit added to [project.optional-dependencies] dev in pyproject.toml
  • CONTRIBUTING.md updated with pre-commit install step in Setup section
  • AGENTS.md updated to mention pre-commit
  • All existing code passes hooks without modifications (green-only constraint)
  • make ci still passes

File paths

  • .pre-commit-config.yaml (create)
  • pyproject.toml (edit — add pre-commit to dev deps)
  • CONTRIBUTING.md (edit — add pre-commit install step)
  • AGENTS.md (edit — mention pre-commit)

Dependencies

  • None (independent quick win)

Estimated effort

S (1 day)</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: dgenio <12731907+dgenio@users.noreply.github.com>
Copilot AI changed the title [WIP] Add .pre-commit-config.yaml with ruff format and check hooks docs: mention pre-commit in AGENTS.md and CLAUDE.md Mar 4, 2026
@dgenio dgenio requested a review from Copilot March 4, 2026 17:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates agent-facing documentation so contributors (including AI agents) install and benefit from the repo’s existing pre-commit hooks, reducing CI-only feedback for formatting/lint issues.

Changes:

  • Add pre-commit install as a top-priority “Do” item in CLAUDE.md.
  • Add a short post-clone note in AGENTS.md explaining the ruff hooks run on commit.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
CLAUDE.md Adds an explicit “pre-commit install” setup step to the Claude checklist.
AGENTS.md Documents running pre-commit install after cloning and what hooks run.

You can also share your feedback on Copilot code review. Take the survey.

Align pre-commit hook descriptions with CONTRIBUTING.md by noting the standard file hygiene checks (trailing-whitespace, end-of-file-fixer, check-yaml, check-json) alongside the ruff hooks.
@dgenio dgenio marked this pull request as ready for review March 4, 2026 18:10
@dgenio dgenio merged commit fbcddb4 into main Mar 4, 2026
3 checks passed
@dgenio dgenio deleted the copilot/add-pre-commit-config branch March 4, 2026 18:11
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.

[infra] Add .pre-commit-config.yaml with ruff format + check hooks

3 participants