[CHORE]: Follow up with our custom pre-commit issues for open source #55
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dunwright/git-herald#55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What needs to be done?
Issue: Improve Pre-commit + Tox Setup Guide
Background
We have an internal guide (
how-to-pre-commit-tox.md) documenting our pre-commit + tox integration. This issue captures improvements to the guide and contributor setup before the project goes open source.CI tests have been intentionally removed due to prohibitive runtime (10–20x longer than local runs). As a result, the
pre-pushhook is now the primary automated safety net before code reaches the remote. This makes the guide and the contributor setup process more important to get right.What Needs To Be Done
1. Document hook latency expectations
Tox has a startup cost even with warm environments — typically 3–5 seconds per hook on a fast machine, longer on slower ones. The guide should set this expectation explicitly so contributors aren't surprised.
Where: Add a note in Section 2 (
.pre-commit-config.yaml) or a new "Performance" section.2. Clarify the
language: systemassumptionThe hooks use
language: system, which requirestoxto be available on PATH. This is a safe assumption for our project since deps are expected to be in place, but it should be stated explicitly so contributors know what's expected of their environment.Where: Add a note under the hook that uses
language: system, or in the Prerequisites section.3. Explain the two-commit behaviour after auto-format
When
tox -e formatmodifies files during a commit, pre-commit stages the changes but the commit still fails — by design. The contributor must review the changes and rungit commita second time. This surprises people the first time.Where: Add a one-paragraph explanation in Section 4 (How it works), under the
git commitflow.4. Note that
repo: localmakespre-commit autoupdatea non-issueContributors familiar with the standard pre-commit workflow may wonder why there are no pinned versions in
.pre-commit-config.yamland whetherpre-commit autoupdateis needed. The guide should briefly confirm this is intentional — tool versions are managed via tox, not pre-commit.Where: Add a short note in the Philosophy section or as a callout in Section 2.
5. Clarify that environment names must match
tox.iniThe
.pre-commit-config.yamlreferencestox -e format,tox -e lint, andtox -e py313. These names must match the actual environment names defined intox.ini. Contributors using different naming conventions will hit confusing errors.Where: Add a note in Section 2, near the YAML block.
6. Add a
dev-setupmake target (or equivalent)The pre-commit and pre-push hooks must be installed separately:
Contributors who only run the first command will have no pre-push hook, meaning tests won't run before pushing. Since CI no longer runs tests, this is a meaningful gap.
Add a single setup target — e.g. in a
Makefileorjustfile— that runs both commands, and reference it from the contributing guide and the how-to.Suggested target:
Where: New section in the how-to ("Quick Setup"), plus a corresponding entry in
CONTRIBUTING.mdor equivalent.7. Document the decision to remove CI tests
Since the pre-push hook is now the primary test gate, it's worth recording the rationale in the guide or a separate ADR (Architecture Decision Record) so future contributors understand the tradeoff and don't re-add CI tests without that context.
Key points to capture:
Where: A new "CI and Testing Philosophy" section in the how-to, or a separate
docs/decisions/ADR file.Acceptance Criteria
language: systemassumption stated in prerequisites or inlinerepo: local/ noautoupdaterationale notedtox.inicalled outdev-setuptarget added and referenced from the contributing guideScope
Tooling
Definition of Done
merge into main
Additional Context
No response