Skip to content

Add ruff + pre-commit (format + E,F,I) #28

@bordeauxred

Description

@bordeauxred

Why

No formatter or linter is currently enforced. Style will drift as external contributors open PRs. Add ruff + pre-commit with a narrow rule set that is safe to enable in one shot.

What

  • Add [tool.ruff] config to pyproject.toml with line length 99, target py311, and E, F, I lint rules.
  • Exclude benchmark/submodule paths from ruff.
  • Add ruff>=0.4,<0.5 and pre-commit>=3.6 to the dev extra.
  • Create .pre-commit-config.yaml with ruff and ruff-format hooks pinned to a known version.
  • Run the one-shot format/lint pass in a separate commit for easy review.
  • Add style instructions to CONTRIBUTING.md.

Acceptance

  • ruff check --select E,F,I clawloop tests examples exits 0.
  • ruff format --check clawloop tests examples exits 0.
  • Pre-commit hook runs after pre-commit install.

Out of scope

  • Broader semantic lint rule sets such as UP, B, and SIM.
  • CI lint gating; that can be added separately after the first formatting pass lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions