Skip to content

Commit

Permalink
feat: use conventionalcommits as the default preset
Browse files Browse the repository at this point in the history
Nowadays the `conventionalcommits` is the closest thing we have that
looks like a standard and neutral. Also, a new cli option was added:
`--preset`.

BREAKING CHANGE: Previously, the default preset was `angular`. Despite
the similarities, the new one has some differences, such as accepting
exclamation marks (e.g. `feat!:`) for identifying breaking changes. To
restore the previous behavior, use `preset: 'angular'` or the new cli
option, `--preset angular`.

Closes semantic-release#1652
  • Loading branch information
felipecrs committed Mar 8, 2021
1 parent 48def0c commit 9dba09c
Show file tree
Hide file tree
Showing 7 changed files with 17,164 additions and 63 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -48,7 +48,7 @@ This removes the immediate connection between human emotions and version numbers

**semantic-release** uses the commit messages to determine the type of changes in the codebase. Following formalized conventions for commit messages, **semantic-release** automatically determines the next [semantic version](https://semver.org) number, generates a changelog and publishes the release.

By default **semantic-release** uses [Angular Commit Message Conventions](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format). The commit message format can be changed with the [`preset` or `config` options](docs/usage/configuration.md#options) of the [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer#options) and [@semantic-release/release-notes-generator](https://github.com/semantic-release/release-notes-generator#options) plugins.
By default **semantic-release** uses the [Conventional Commits convention](https://www.conventionalcommits.org/). The commit message format can be changed with the [`preset` or `config` options](docs/usage/configuration.md#options) of the [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer#options) and [@semantic-release/release-notes-generator](https://github.com/semantic-release/release-notes-generator#options) plugins.

Tools such as [commitizen](https://github.com/commitizen/cz-cli) or [commitlint](https://github.com/conventional-changelog/commitlint) can be used to help contributors and enforce valid commit messages.

Expand Down
1 change: 1 addition & 0 deletions cli.js
Expand Up @@ -23,6 +23,7 @@ Usage:
.option('r', {alias: 'repository-url', describe: 'Git repository URL', type: 'string', group: 'Options'})
.option('t', {alias: 'tag-format', describe: 'Git tag format', type: 'string', group: 'Options'})
.option('p', {alias: 'plugins', describe: 'Plugins', ...stringList, group: 'Options'})
.option('preset', {describe: 'Commit message format convention', type: 'string', group: 'Options'})
.option('e', {alias: 'extends', describe: 'Shareable configurations', ...stringList, group: 'Options'})
.option('ci', {describe: 'Toggle CI verifications', type: 'boolean', group: 'Options'})
.option('verify-conditions', {...stringList, group: 'Plugins'})
Expand Down
1 change: 1 addition & 0 deletions lib/get-config.js
Expand Up @@ -70,6 +70,7 @@ module.exports = async (context, cliOptions) => {
'@semantic-release/npm',
'@semantic-release/github',
],
preset: 'conventionalcommits',
// Remove `null` and `undefined` options so they can be replaced with default ones
...pickBy(options, (option) => !isNil(option)),
...(options.branches ? {branches: castArray(options.branches)} : {}),
Expand Down

0 comments on commit 9dba09c

Please sign in to comment.