Skip to content

Commit

Permalink
docs: improve the Semantic Commits message documentation (#8027)
Browse files Browse the repository at this point in the history
* reduce capitalization

* full rewrite
  • Loading branch information
HonkingGoose committed Dec 21, 2020
1 parent c6c0544 commit a9888e7
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions docs/usage/semantic-commits.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
---
title: Semantic Commit Messages
title: Semantic Commit messages
description: Configuring Renovate to use Semantic Commits
---

# Semantic Commit Messages
# Semantic Commit messages

Renovate attempts to autodetect if your repository uses "semantic" commit message prefixes, and adds them if so.
To do so, it looks at the 10 most recent commit messages in the base branch and uses [conventional-commits-detector](https://github.com/conventional-changelog/conventional-commits-detector) to determine convention commit type.
To detect if your repository uses semantic commits, Renovate looks at the latest 10 commit messages in the base branch.
It then uses [conventional-commits-detector](https://github.com/conventional-changelog/conventional-commits-detector) to determine what convention the commit messages follow.

Currently, Renovate ignores commit conventions apart from "angular".
Renovate only detects Angular-style conventional commits, it ignores all other commit conventions.

If Angular-style commits are found then Renovate will structure its commit messages and PR titles to be like so:
When Renovate finds Angular-style commits, Renovate will create commit messages and PR titles that look like this:

- chore(deps): update eslint to v4.2.0
- fix(deps): update express to v4.16.2

`chore` is used by default, but `fix` is used for anything in the "dependencies" section of `package.json`.
Renovate uses `chore` by default, but uses `fix` for updates to your production dependencies in your `package.json` file.

## Manually enabling or disabling semantic commits

If you wish to manually override Renovate's semantic commit detection, then you can add either `":semanticCommits"` or `":semanticCommitsDisabled"` to your `extends` array.
You can override the default settings, and disable or enable semantic commits.

## Changing the Semantic Commit Type
If you want Renovate to use semantic commits: add `":semanticCommits"` to your `extends` array.

If you wish to say use "chore" for every PR, then you can add `":semanticCommitTypeAll(chore)"` to your `extends` array.
Or if you wish to use `ci` then you would add `":semanticCommitTypeAll(ci)"` instead.
This second case would mean your PR titles and commit messages will start with "ci(deps):".
If you want Renovate to stop using semantic commits, add `":semanticCommitsDisabled"` to your `extends` array.

## Changing the Semantic Commit Scope
## Changing the Semantic Commit type

If you don't like "deps" then this can also be configured.
For example, to set it to "package" you should add the preset `":semanticCommitScope(package)"` to your `extends` array.
You can change the Semantic Commit type that Renovate uses.

If you wish to _remove_ the semantic commit scope (e.g. use prefix `chore:` instead of `chore(deps):`) then you should add the preset `":semanticCommitScopeDisabled"` to your `extends` array.
Say you want Renovate to use "chore" for every PR, you can add `":semanticCommitTypeAll(chore)"` to your `extends` array.
PR titles and commit messages start with "chore(deps):"

Or say you want to use "ci" for every PR, then you would add `":semanticCommitTypeAll(ci)"` to your `extends` array instead.
PR titles and commit messages start with "ci(deps):"

## Changing the Semantic Commit scope

If you don't like the default "deps" scope, you can use another word for the scope instead.
For example, to set the scope to "package" instead, add the preset `":semanticCommitScope(package)"` to your `extends` array.

If you want to _remove_ the semantic commit scope (e.g. use prefix `chore:` instead of `chore(deps):`), then add the preset `":semanticCommitScopeDisabled"` to your `extends` array.

0 comments on commit a9888e7

Please sign in to comment.