Skip to content

Add Pre-commit Hook Configuration with cargo fmt and clippy #289

@Timi16

Description

@Timi16

Description

Add a pre-commit hook configuration using pre-commit framework so contributors automatically have their code formatted and linted before every commit — preventing CI failures from simple formatting issues.

Requirements

  • Add .pre-commit-config.yaml to repo root
  • Hook 1: run cargo fmt --check and auto-fix
  • Hook 2: run cargo clippy -- -D warnings
  • Hook 3: run cargo test (optional, skip-able with --no-verify)
  • Add setup instructions to CONTRIBUTING.md

Suggested Execution

  1. Branch: git checkout -b dx/pre-commit-hooks
  2. Create .pre-commit-config.yaml
  3. Configure rust-specific hooks
  4. Test hooks locally
  5. Add installation instructions to CONTRIBUTING.md
  6. Commit: dx: add pre-commit hooks for fmt and clippy

Acceptance Criteria

  • .pre-commit-config.yaml created and working
  • cargo fmt hook runs on commit
  • cargo clippy hook runs on commit
  • Installation instructions in CONTRIBUTING.md
  • Hooks tested on a real commit

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions