This is adapted from Angular's commit convention.
Messages must be matched by the following regex:
/^(Revert: )?(Feature|Fix|Docs|Improve|Config|Example|Refactor|Style|Test|Build|CI)(\(.+\))?: .{1,80}/
Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
The header is mandatory and the scope of the header is optional.
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
The footer should contain a closing reference to an issue if any.
Samples: (even more samples)
Docs(changelog): update changelog to beta.5
Feature($browser): onUrlChange event (popstate/hashchange/polling)
Added new event to $browser:
- forward popstate event if available
- forward hashchange event if popstate not available
- do polling when neither popstate nor hashchange available
Breaks $browser.onHashChange, which was removed (use onUrlChange instead)
Fix(release): need to depend on latest rxjs and zone.js
The version in our package.json gets copied to the one we publish, and users need the latest of these.
Closes #123, #245, #992
BREAKING CHANGE: isolate scope bindings definition has changed and
the inject option for the directive controller injection was removed.
To migrate the code follow the example below:
Before:
scope: {
myAttr: 'attribute',
myBind: 'bind',
myExpression: 'expression',
myEval: 'evaluate',
myAccessor: 'accessor'
}
After:
scope: {
myAttr: '@',
myBind: '@',
myExpression: '&',
// myEval - usually not useful, but in cases where the expression is assignable, you can use '='
myAccessor: '=' // in directive's template change myAccessor() to myAccessor
}
The removed `inject` wasn't generaly useful for directives so there should be no code using it.
If the commit reverts a previous commit, it should begin with Revert:
, followed by the header of the reverted commit. In the body it should say: This reverts commit <hash>.
, where the hash is the SHA of the commit being reverted.
Must be one of the following:
- Build: Changes that affect the build system or external dependencies (example scopes: gulp, npm, yarn)
- CI: Changes to CI related configuration files and scripts (example scopes: travis, circle, browserstack)
- Config: Changes to other configuration files (example scopes: webpack, babel, docker)
- Docs: Documentation only changes (example scopes: readme, changelog)
- Example: Changes for example code
- Feature: A new feature
- Fix: A bug fix
- Improve: Backwards-compatible enhancement changes
- Refactor: A code change that neither fixes a bug nor adds a feature
- Style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- Test: Changes for testing code
If the prefix is Feature
or Fix
, it will appear in the changelog. However if there is any BREAKING CHANGE, the commit will always appear in the changelog.
The scope could be anything specifying place of the commit change. For example core
, compiler
, ssr
, v-model
, transition
etc...
The subject contains succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end
Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit Closes.
Breaking Changes should start with the word BREAKING CHANGE:
with a space or two newlines. The rest of the commit message is then used for this.
A detailed explanation can be found in this document