Skip to content

Commit

Permalink
tweaks: tweaks should be patch
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jan 3, 2017
1 parent 33b96b3 commit 69c0fc9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -54,11 +54,11 @@ You can also use format like `type: message` to pre-define commit type, they wil
|test|add missing tests|ignore||
|breaking|introduce breaking changes|major|minor|
|perf|performance improvements|patch||
|tweaks|don't know how to describe|ignore||
|tweaks|don't know how to describe|patch||

**Note**: in 0.y.z versions, major changes will affect `y`, other changes and patches will affect `z`. So in such situation you can never reach `1.0.0` do you? Then just explicitly specific the version for your next release, like: `changelog 1.0.0`

For `tweaks: message`, a message with only `tweaks` or `tweak` will also be ignored.
For `tweaks: subject`, a message with only `tweaks` or `tweak` will also be a patch.

You don't have to use these types in your commit message since you can set them one by one when actually running `changelog` (only for CHANGELOG.md, will not update the commit itself).

Expand Down
6 changes: 4 additions & 2 deletions lib/index.js
Expand Up @@ -56,10 +56,12 @@ module.exports = co.wrap(function * ({
const type = semanticType(match[1])
if (type) {
commit.subject = commit.subject.replace(re, '')
commit.type = match[1]
commit.type = type
}
} else if (isReleaseMessage || isSimpleTweaks) {
} else if (isReleaseMessage) {
commit.type = 'ignore'
} else if (isSimpleTweaks) {
commit.type = 'patch'
}
return commit
}).reverse()
Expand Down
4 changes: 2 additions & 2 deletions lib/semantic-type.js
Expand Up @@ -4,8 +4,8 @@ module.exports = function (type) {
const types = {
docs: 'ignore',
doc: 'ignore',
tweaks: 'ignore',
tweak: 'ignore',
tweaks: 'patch',
tweak: 'patch',
fix: 'patch',
fixes: 'patch',
feat: 'minor',
Expand Down

0 comments on commit 69c0fc9

Please sign in to comment.