feat: adding linter for commits
This commit is contained in:
32
node_modules/conventional-changelog-angular/conventional-recommended-bump.js
generated
vendored
Normal file
32
node_modules/conventional-changelog-angular/conventional-recommended-bump.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
'use strict'
|
||||
|
||||
const parserOpts = require('./parser-opts')
|
||||
|
||||
module.exports = {
|
||||
parserOpts,
|
||||
|
||||
whatBump: (commits) => {
|
||||
let level = 2
|
||||
let breakings = 0
|
||||
let features = 0
|
||||
|
||||
commits.forEach(commit => {
|
||||
if (commit.notes.length > 0) {
|
||||
breakings += commit.notes.length
|
||||
level = 0
|
||||
} else if (commit.type === 'feat') {
|
||||
features += 1
|
||||
if (level === 2) {
|
||||
level = 1
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
level: level,
|
||||
reason: breakings === 1
|
||||
? `There is ${breakings} BREAKING CHANGE and ${features} features`
|
||||
: `There are ${breakings} BREAKING CHANGES and ${features} features`
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user