Skip to content

chore: enforce Black formatting in pre-commit and CI to prevent drift #3408

@mrveiss

Description

@mrveiss

Summary

89 Python files drifted from Black formatting standards and were discovered via CI check (2026-04-03). The files were reformatted manually in commit `76ac6c7e8`. Without enforcement, this will recur.

Discovery

Found during routine session — Black `--check` on `autobot-backend/` and `autobot-slm-backend/` reported 89 files needing reformat. No pre-commit hook was preventing the drift.

Proposed Fix

  1. Verify `.pre-commit-config.yaml` includes Black with auto-format on staged files
  2. Ensure all developers run `pre-commit install` after cloning
  3. Confirm CI pipeline runs `black --check` as a blocking step
  4. Consider adding `isort --profile black` check alongside Black

Acceptance Criteria

  • Pre-commit hook runs Black on staged `.py` files before every commit
  • CI `black --check` step is present and blocking
  • No files fail `black --check` after changes are applied

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions