Rules by commit type
Different commit types need different context. A bug fix should explain the root cause; a performance change should include metrics. Here are the default required and recommended sections per type.
| Type | Required | Recommended |
|---|---|---|
| fix | Why, Cause | Covers |
| feat | Why | Approach, Alternatives |
| refactor | Why, Approach | Alternatives, Invariants |
| perf | Why, Metrics | Approach, Tradeoffs |
These defaults can be customized in your commitlint config.