You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pre-commit step sequence is a hardcoded tuple in forge.precommit.run_all (src/forge/precommit.py:585). Whether a given
step runs is decided by three different ad-hoc mechanisms, with no
single place a consumer can turn a step on or off:
Always-on — ruff, docstrings, test_naming run unconditionally
(modulo source-dir presence).
Opt-in via a step-specific table — cli_wiring requires [tool.forge.cli_wiring] enabled = true; docstring_coverage reads [tool.forge.docstring_coverage]; the proposed doctest step (feat: doctest pre-commit step + CI integration #5) would
add yet another [tool.forge.doctest].
File-presence conditional — manifest_json / plugin_version
self-skip when .claude-plugin/ is absent; pip_audit skips when pip-audit is off PATH.
There is no [tool.forge.precommit] table and no --skip / --only CLI
flag. A consumer who wants to drop one step (e.g. silence pip_audit
entirely, or disable repo_structure in a repo that doesn't keep REPO_STRUCTURE.md) has no uniform lever — they must either edit .githooks/pre-commit by hand or rely on whatever bespoke gate that one
step happens to expose.
Proposal
A single override layer applied uniformly in run_all, on top of (not
replacing) each step's existing self-skip:
[tool.forge.precommit] config table
[tool.forge.precommit]
disable = ["pip_audit"] # force-skip these steps by nameenable = ["doctest"] # opt in to normally-off steps by name
Read once at the top of run_all; a disabled step yields a StepResult(skipped=True, output="(disabled via [tool.forge.precommit])")
so the skip is visible in the log, not silent.
--skip <step> / --only <step> CLI flags on forge-precommit for
ad-hoc local runs (repeatable, validated against the known step names).
The per-step bespoke gating stays as the default behavior; this is an
override layer, not a rewrite. Step names are the existing StepResult.name
values (ruff, docstrings, docstring_coverage, test_naming, repo_structure, manifest_json, cli_wiring, commit_types_parity, plugin_version, pip_audit).
Guardrails
Disabling must be visible. A disabled step renders as an explicit SKIP (disabled) line + log entry — never a silent omission. Weakening a
quality gate should leave a trail (FOUNDATION §2 "never bypass", §4
scope policy).
--only is for local iteration, not CI. Document that CI should run
the full sequence; --only is a dev-loop convenience.
Unknown step name → hard error, not silent no-op (catches typos).
Acceptance criteria
[tool.forge.precommit] disable / enable honored by run_all,
applied uniformly to every step.
Disabled steps surface as skipped=True with a "disabled" reason in the
log and the printed line.
--skip / --only flags on forge-precommit, validated against known
step names (unknown → exit non-zero with the valid list).
Unknown step name in config or flag is an error, not a no-op.
Tests cover: disable a normally-on step, enable a normally-off step, --only single step, --skip repeated, unknown-name error.
Out of scope
Reordering steps (the sequence is fixed; this only toggles membership).
Per-step config beyond enable/disable (each step keeps its own table for
step-specific options like docstring_coverage.badge).
Related
forge.precommit.run_all (src/forge/precommit.py:585) — the hardcoded
sequence this layers an override onto.
_cli_wiring_enabled (src/forge/precommit.py:468) — example of the
current per-step ad-hoc opt-in this would generalize.
Problem
The pre-commit step sequence is a hardcoded tuple in
forge.precommit.run_all(src/forge/precommit.py:585). Whether a givenstep runs is decided by three different ad-hoc mechanisms, with no
single place a consumer can turn a step on or off:
ruff,docstrings,test_namingrun unconditionally(modulo source-dir presence).
cli_wiringrequires[tool.forge.cli_wiring] enabled = true;docstring_coveragereads[tool.forge.docstring_coverage]; the proposeddocteststep (feat: doctest pre-commit step + CI integration #5) wouldadd yet another
[tool.forge.doctest].manifest_json/plugin_versionself-skip when
.claude-plugin/is absent;pip_auditskips whenpip-auditis off PATH.There is no
[tool.forge.precommit]table and no--skip/--onlyCLIflag. A consumer who wants to drop one step (e.g. silence
pip_auditentirely, or disable
repo_structurein a repo that doesn't keepREPO_STRUCTURE.md) has no uniform lever — they must either edit.githooks/pre-commitby hand or rely on whatever bespoke gate that onestep happens to expose.
Proposal
A single override layer applied uniformly in
run_all, on top of (notreplacing) each step's existing self-skip:
[tool.forge.precommit]config tableRead once at the top of
run_all; a disabled step yields aStepResult(skipped=True, output="(disabled via [tool.forge.precommit])")so the skip is visible in the log, not silent.
--skip <step>/--only <step>CLI flags onforge-precommitforad-hoc local runs (repeatable, validated against the known step names).
The per-step bespoke gating stays as the default behavior; this is an
override layer, not a rewrite. Step names are the existing
StepResult.namevalues (
ruff,docstrings,docstring_coverage,test_naming,repo_structure,manifest_json,cli_wiring,commit_types_parity,plugin_version,pip_audit).Guardrails
SKIP (disabled)line + log entry — never a silent omission. Weakening aquality gate should leave a trail (FOUNDATION §2 "never bypass", §4
scope policy).
--onlyis for local iteration, not CI. Document that CI should runthe full sequence;
--onlyis a dev-loop convenience.Acceptance criteria
[tool.forge.precommit] disable/enablehonored byrun_all,applied uniformly to every step.
skipped=Truewith a "disabled" reason in thelog and the printed line.
--skip/--onlyflags onforge-precommit, validated against knownstep names (unknown → exit non-zero with the valid list).
--onlysingle step,--skiprepeated, unknown-name error.Out of scope
step-specific options like
docstring_coverage.badge).Related
forge.precommit.run_all(src/forge/precommit.py:585) — the hardcodedsequence this layers an override onto.
_cli_wiring_enabled(src/forge/precommit.py:468) — example of thecurrent per-step ad-hoc opt-in this would generalize.
enablelist instead ofinventing a fourth bespoke gate.
not undermine.