|
| 1 | +# Story 4.5: Update Conventional Commit Scopes for All Languages |
| 2 | + |
| 3 | +Status: ready-for-dev |
| 4 | + |
| 5 | +## Story |
| 6 | + |
| 7 | +As a developer, |
| 8 | +I want the pre-commit conventional commits hook to accept all current language scopes, |
| 9 | +so that commits for Ruby, Go, JavaScript, Rust, and new workflow scopes are not rejected. |
| 10 | + |
| 11 | +## Acceptance Criteria |
| 12 | + |
| 13 | +1. The hook accepts all language scopes: python, bash, terraform, ansible, ruby, go, javascript, rust |
| 14 | +2. The hook accepts all workflow scopes: container, ci, makefile, standards, security, changelog, release |
| 15 | +3. The updated hook version is referenced in both template repos' `.pre-commit-config.yaml` |
| 16 | +4. The dev-toolchain repo's `.pre-commit-config.yaml` references the updated hook |
| 17 | +5. `make check` passes on all updated repos |
| 18 | + |
| 19 | +## Tasks / Subtasks |
| 20 | + |
| 21 | +- [ ] Task 1: Update pre-commit-conventional-commits repo (AC: 1, 2) |
| 22 | + - [ ] 1.1 Update `VALID_SCOPES` in `conventional_commits/config.py` — add: ruby, go, javascript, rust, security, changelog, release |
| 23 | + - [ ] 1.2 Update test suite in `tests/test_check.py` — add parametrized cases for new scopes |
| 24 | + - [ ] 1.3 Update `tests/test_config.py` — verify VALID_SCOPES count matches expected |
| 25 | + - [ ] 1.4 Update README.md — add new scopes to the valid scopes list |
| 26 | + - [ ] 1.5 Sync DEVELOPMENT.md — add rust, security, changelog, release (ruby/go/javascript already there) |
| 27 | + - [ ] 1.6 Run `make check` and all tests pass |
| 28 | + - [ ] 1.7 Tag new version (v1.1.0 — minor bump for new scopes) |
| 29 | + |
| 30 | +- [ ] Task 2: Update dev-toolchain `.pre-commit-config.yaml` (AC: 4) |
| 31 | + - [ ] 2.1 Bump `rev:` from `v1.0.0` to `v1.1.0` for the conventional-commits hook |
| 32 | + - [ ] 2.2 Run `make check` passes |
| 33 | + |
| 34 | +- [ ] Task 3: Update github-repo-template `.pre-commit-config.yaml` (AC: 3) |
| 35 | + - [ ] 3.1 Bump `rev:` from `v1.0.0` to `v1.1.0` for the conventional-commits hook |
| 36 | + - [ ] 3.2 Run `make check` passes |
| 37 | + |
| 38 | +- [ ] Task 4: Update gitlab-repo-template `.pre-commit-config.yaml` (AC: 3) |
| 39 | + - [ ] 4.1 Bump `rev:` from `v1.0.0` to `v1.1.0` for the conventional-commits hook |
| 40 | + - [ ] 4.2 Run `make check` passes |
| 41 | + |
| 42 | +## Dev Notes |
| 43 | + |
| 44 | +- The scope validation is hardcoded in Python: `conventional_commits/config.py` uses a `frozenset` called `VALID_SCOPES` |
| 45 | +- The check module (`check.py`) uses regex `r"^(?P<type>[a-z]+)\((?P<scope>[a-z]+)\): (?P<description>.+)$"` and validates scope membership |
| 46 | +- Current `VALID_SCOPES` in config.py: python, terraform, bash, ansible, container, ci, makefile, standards (8 scopes) |
| 47 | +- DEVELOPMENT.md already documents ruby, go, javascript but config.py doesn't implement them — this is a known doc/code mismatch |
| 48 | +- All three downstream repos (dev-toolchain, github-template, gitlab-template) pin `rev: v1.0.0` with no hook_args overrides |
| 49 | +- No hook_args mechanism exists for per-repo scope customization — scopes are centralized in the hook package |
| 50 | + |
| 51 | +### Project Structure Notes |
| 52 | + |
| 53 | +- `pre-commit-conventional-commits/` — source of truth for scope validation |
| 54 | + - `conventional_commits/config.py` — VALID_SCOPES frozenset |
| 55 | + - `conventional_commits/check.py` — regex + validation logic |
| 56 | + - `tests/test_check.py` — parametrized acceptance tests |
| 57 | + - `tests/test_config.py` — config validation tests |
| 58 | +- Downstream consumers all use identical hook config block (no per-repo overrides) |
| 59 | + |
| 60 | +### References |
| 61 | + |
| 62 | +- [Source: pre-commit-conventional-commits/conventional_commits/config.py] — VALID_SCOPES definition |
| 63 | +- [Source: pre-commit-conventional-commits/conventional_commits/check.py] — validation logic |
| 64 | +- [Source: dev-toolchain/.pre-commit-config.yaml] — rev: v1.0.0 |
| 65 | +- [Source: github-repo-template/.pre-commit-config.yaml] — rev: v1.0.0 |
| 66 | +- [Source: gitlab-repo-template/.pre-commit-config.yaml] — rev: v1.0.0 |
| 67 | +- [Source: epics.md#Story 4.5] — acceptance criteria |
| 68 | + |
| 69 | +## Dev Agent Record |
| 70 | + |
| 71 | +### Agent Model Used |
| 72 | + |
| 73 | +### Debug Log References |
| 74 | + |
| 75 | +### Completion Notes List |
| 76 | + |
| 77 | +### File List |
0 commit comments