Require a scope on the version-driving commit types (ADR-0034)#294
Merged
Conversation
Record the decision that commit-lint requires a scope on the two version-driving types (feat, fix): the release tooling partitions commits into trains by scope, so an unscoped feat/fix is silently dropped from the release notes and the changelog. The ADR weighs the alternatives (keep documenting only, require a scope on every type, change the release tooling), is drafted bilingually, and is indexed. Refs: #293
feat and fix are the only version-driving types, and the release tooling (tools/trains.sh) routes commits to trains by scope; an unscoped feat/fix matches no train and is silently dropped from the release notes and the changelog, so a user-facing change can vanish from the release record. Reject an unscoped feat/fix at the commit-msg hook and in CI, naming the consequence. Every other type keeps the scope optional. Refs: #293
Update the Scope section (EN + FR) from "a user-facing change must carry a scope" to the rule commit-lint now enforces: a scope is required on feat and fix and rejected when absent, at the hook and in CI, and optional on every other type. Link ADR-0034. Refs: #293
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enforce, in
commit-lint, that the two version-driving types —featandfix— carry a scope, and reject an unscoped one at thecommit-msghook and in CI. This closes the release-record gap surfaced and documented by #231 / #292: the release tooling partitions commits into trains by scope, so an unscoped user-facingfeat:/fix:matched no train and was silently dropped from the release notes and changelog. The decision is recorded as ADR-0034 (Accepted); CONTRIBUTING is updated (EN + FR) from a documented convention to the enforced rule.Type of change
Changes
tools/commit-lint/lint-commit-message.sh— a well-formedfeat/fixheader with no scope is now rejected, at the localcommit-msghook and in the CI check (one shared script), with a message that names the consequence. Every other type keeps the scope optional. Contributor-facing behaviour change:feat: …/fix: …with no scope, valid before, is now refused; add a scope (feat(core): …).doc/handwritten/for-maintainers/adr/, EN + FR, indexed) — records the decision, its rationale, and the alternatives weighed (keep documenting only; require a scope on every type; change the release tooling to keep unscoped commits). Marked Accepted per the maintainer's explicit acceptance.CONTRIBUTING.md/CONTRIBUTING.fr.md— the Scope section now states the enforced rule (scope required onfeat/fix, optional elsewhere) instead of a convention to remember, and links ADR-0034.No CI-workflow YAML change (the
commit-lintworkflow already invokes the shared script) and no release-tooling change (the partition semantics are unchanged; only the linter gains the requirement).Testing
No library code changed, so the build/test suite was not run:
dotnet build FirstClassErrors.sln— not run (no code change)dotnet test FirstClassErrors.sln— not run (no code change)FirstClassErrors.Analyzers.UnitTests) — not run (no analyzer change)Verified the linter behaviour directly by running the script against a matrix:
feat:/fix:with no scope are rejected;feat(scope):,fix(scope,scope):, and the non-version-driving types (docs:,ci:,chore:,refactor:,perf:) with no scope all pass. The three commits of this PR themselves pass thecommit-msghook (and will pass the CI lint).Documentation
doc/updated — CONTRIBUTING (Scope section) and a new ADR.README.fr.mdis not among the touched files.Architecture decisions
Related issues
Closes #293
🤖 Generated with Claude Code
Generated by Claude Code