Skip to content

Add pre-commit hooks for code quality #11

@manavgup

Description

@manavgup

Context

Borrowed from IBM/mcp-context-forge which uses .pre-commit-config.yaml with fail_fast: true.

Currently nothing prevents pushing unformatted or broken code. make check is manual.

What to do

  • Add .pre-commit-config.yaml with:
    • ruff (lint + format)
    • black (formatting)
    • Python AST validity check
    • Debug statement detection (breakpoint(), pdb)
    • Private key / secrets detection
    • YAML/JSON/TOML validation
    • Trailing whitespace, end-of-file fixer
  • Add pre-commit to dev dependencies
  • Add make pre-commit-install target
  • Document in DEVELOPING.md

Acceptance criteria

  • pre-commit run --all-files passes
  • Hooks auto-run on git commit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions