Originally created by: fu351
Originally owned by: jonah-boop
The repo has no pre-commit config anywhere (verified: no .pre-commit-config.yaml, no pre-commit dependency in pyproject.toml, no mention in CONTRIBUTING.md). Contributors currently only find out they broke ruff check / ruff format / lint-imports when CI runs (.github/workflows/ci.yml). Add a .pre-commit-config.yaml at the repo root running ruff check --fix, ruff format, and lint-imports as local git hooks, and document pre-commit install as an optional step in CONTRIBUTING.md's "Local setup" section.
Mechanical: no application code changes — transcribe the same ruff/lint-imports invocations CI already runs into a pre-commit config, so it fails the same way CI does.
ruff check, ruff format --check, lint-imports) — do not add --unsafe-fixes or any autofix mode that could silently rewrite security-relevant logic (e.g. the redaction/canonicalization helpers) without a human reviewing the diff.pre-commit is a local, optional convenience — it must not become a required CI gate in this issue (CI already gates independently) and must not change any command's actual behavior, only when contributors are warned about it..pre-commit-config.yaml.pyproject.toml — add pre-commit to the dev optional-dependencies group.CONTRIBUTING.md — "Local setup" section (lines 8–17); add a pre-commit install step..pre-commit-config.yaml runs ruff check, ruff format --check, and lint-imports on pre-commit run --all-files.pre-commit is added to pyproject.toml's dev extras.CONTRIBUTING.md documents pip install -e ".[dev]" → pre-commit install as an optional local step.ruff check . && ruff format --check . and lint-imports passpytest passespip install -e ".[dev]"
pre-commit install
pre-commit run --all-files
ruff check --fix / ruff format (no --unsafe-fixes).New here? Start with CONTRIBUTING.md. Issues are labelled level-1 (docs only) through level-10 (new subsystem) — pick one at your level and climb. Comment to claim an issue before starting.
Originally posted by: fu351
Re-leveled 6 → 2 and marked good-first. This is a
.pre-commit-config.yamlrunning ruff and lint-imports to mirror the CI commands — a copy-and-map job that's genuinely a good first contribution, not a level-6.Originally posted by: jonah-boop
I’d like to take this issue.
I verified the current
CONTRIBUTING.md,pyproject.toml, and CI workflow. My planned scope is:.pre-commit-config.yamlhooks for the existing CI commands:ruff check .,ruff format --check ., andlint-imports;pass_filenames: falseso each hook checks the same repository scope as CI;pre-committo thedevextra;pre-commit installas an optional local step; andpre-commit run --all-filesplus the repository’s full documented quality gates before opening the PR.One scope point: the issue prose mentions
ruff check --fix/ruff format, while the acceptance criteria and “mirror CI” requirement specify the non-mutatingruff check/ruff format --checkcommands. I’ll follow the non-mutating acceptance criteria unless you prefer otherwise.I’ll keep this to one focused tooling/docs PR and disclose AI assistance in the PR description, as required by the contribution guide.
Originally posted by: fu351
@jonah-boop That is a model claim comment: you verified the config against CI before asking, and you caught the one real discrepancy in the issue text. Go with the non-mutating pair (
ruff check,ruff format --check). The acceptance bar is "fails the same way CI does", and a--fixhook mutates at commit time, which CI never does. Your five-point scope is right, includingpass_filenames: false. It's yours - assigning now.Quick community roll-call: are you in the Doberman Discord? If yes, drop your handle here (or DM me there) so I can match the GitHub side of your work to your Discord name. If not, you're warmly invited: https://discord.gg/Sfy5XGNqty
Originally posted by: fu351
@jonah-boop checking in on [#195], no rush. If anything about the pre-commit setup is unclear ask here and I'll help. If you've moved on that's fine too, just let me know and I'll unassign it.
Related
Tickets: #195