Skip to content

[Docs] Fix "Conventional Commit" commit message format #3627

@BinToss

Description

@BinToss

#### Conventional commit messages
If you want to use the [Conventional Commits][conventional-commits] standard,
you can leverage this feature as follows:
```yaml
mode: MainLine # Only add this if you want every version to be created automatically on your main branch.
major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:"
patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:"
```
This will ensure that your version gets bumped according to the commits you've
created.

The current Conventional Commit configuration breaks the standard's rules. Where PATCH is supposed to be incremented by only fix or perf, the configuration increments PATCH when the commit Type is any Angular commit Type except feat and no breaking change is present.

Additionally, the following should be noted for consumers:

  • In Conventional Commit 1.0.0, revert-type commits do not explicitly increment the version as their significance differs on a case-by-case basis. The convention gives the following format recommendation:
    revert: let us never again speak of the noodle incident
    
    Refs: 676104e, a215868
    
  • Some software used in tandem with GitVersion may use version-increment rules not present in a given commit convention preset (e.g. angular, conventionalcommits). @semantic-release/commit-analyzer v10.0.1, for example, will increment PATCH for any revert commits regardless of the (in)significance of the reverted changes. This semantic-release behavior can be counteracted by adding custom rules to @semantic-release/commit-analyzer's configuration. Rather than RegEx, commit-analyzer uses Micromatch's glob implementation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions