Skip to content

Add pre-commit config to enforce black/isort/ruff locally #422

@jwm4

Description

@jwm4

Problem

AgentReady has no .pre-commit-config.yaml, which means formatting checks only run in CI — not before a developer commits. This creates a slow feedback loop: a formatting issue isn't caught until CI runs, requiring an extra fix commit and, when PRs are stacked, a cascade of rebases.

PR #421 is a concrete example: a two-character f-string fix needed its own dedicated PR purely because black formatting wasn't caught locally before the original commit. That's direct velocity loss.

Our own guidance requires this

DeterministicEnforcementAssessor penalizes repos that lack pre-commit hook enforcement. AgentReady is currently failing its own check on this attribute — we should practice what we preach.

Proposed solution

Add a .pre-commit-config.yaml with hooks for:

  • black (formatting)
  • isort (import ordering)
  • ruff (linting)

These are already dev dependencies, so the hooks can use the pre-commit framework's mirror repos (e.g. psf/black, PyCQA/isort, astral-sh/ruff-pre-commit) and manage their own isolated environments. Developers only need to run:

uv tool install pre-commit
pre-commit install

Consider adding this to a make setup or onboarding step to reduce friction further.

References


Filed by Claude Code under the supervision of Bill Murdock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions