git-conventional-commits icon indicating copy to clipboard operation
git-conventional-commits copied to clipboard

RFE: allow to use multiple commit types per changelog section

Open McFoggy opened this issue 2 years ago • 4 comments

Would you be open to a change that would allow to group several commit types inside a changelog section, configuration could be something like:

  headlines:
    feat: Features
    "fix,style": Enhancements
    perf: Performance Improvements
    "ci,build,ops": CI/CD
    "chore,docs": Misc
    breakingChange: BREAKING CHANGES

Note that such a change is backward compatible with what exists today.

McFoggy avatar Sep 20 '23 14:09 McFoggy

Hi @McFoggy, your idea sounds interesting. But first thing first :-) what does RFE stands for?

qoomon avatar Sep 20 '23 14:09 qoomon

I think the easiest solution would be to set the same headline for the types and group by headlines, this way you get an syntax error in yaml if you define a value twice.

Example

headlines:
    feat:  Features
    fix:   Enhancements
    style: Enhancements
    perf:  Performance Improvements
    ci:    CI/CD
    build: CI/CD
    ops:   CI/CD
    chore: Misc
    docs:  Misc
    breakingChange: BREAKING CHANGES

Because it is an edge case, the redundancy is okay in my opinion. WDYT?

qoomon avatar Sep 20 '23 14:09 qoomon

Or I could add a new sections field e.g.

sections:
   Features: [feat]
   Enhancements: [fix, style]
   Performance Improvements: [perf]
   CI/CD: [ci, build, ops]
   Misc: [chore, docs]
   BREAKING CHANGES: [breakingChange]

qoomon avatar Sep 21 '23 14:09 qoomon

The new approach could also replace the commitTypeslist before

changelog:
 commitTypes:
  - feat
  - fix
  - perf
  - merge
  headlines:
    feat: Features
    fix: Bug Fixes
    perf: Performance Improvements
    merge: Merges
    breakingChange: BREAKING CHANGES
changelog:
  categories:
    Features: [feat]
    Bug Fixes: [fix]
    Performance Improvements: [perf]
    Merges: [merge]
    BREAKING CHANGES: [breakingChange]

or

changelog:
  categories:
  - title: Features
    commitTypes: 
    - feat
  - title: Bug Fixes
    commitTypes: 
    - fix
  - title: Performance Improvements
    commitTypes: 
    - perf
  - title: Merges
    commitTypes: 
    - merge
  - title: BREAKING CHANGES
    commitTypes: 
    - breakingChange

WDYT?

qoomon avatar Sep 29 '23 07:09 qoomon