5
commit analysis
Pierre Vanduynslager edited this page 2017-10-25 10:56:10 -04:00

default analyzer

The default analyzer implements the AngularJS Commit Message Convention style.

<type>(<scope>): <subject>
<BLANK LINE>
<body>

Examples:

feat(ruler): add inches as well as centimeters
fix(protractor): fix 90 degrees counting as 91 degrees
fix(pen): use blue ink instead of red ink

BREAKING CHANGE: Pen now uses blue ink instead of red.

To migrate, change your code from the following:

`pen.draw('blue')`

To:

`pen.draw('red')`

Synopsis

custom analyzers

If you want to use commit message conventions other than Angular's you can provide your own analyzer in the package.json.

Add a release field and provide a path where semantic-release can require your analyzer:

"release": {
  "analyzer": "./lib/custom-analyzer"
}

The module should export a function that takes an array of commit objects ({hash: '123456', message: 'changed stuff') and returns the the release type ('major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', or 'prerelease'), or null to not release a new version.

Have a look at the default analyzer for a sample implementation.