-
Notifications
You must be signed in to change notification settings - Fork 924
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config-angular): update to latest convention (#123)
* refactor(config-angular): break out config-angular-type-enum * feat(config-angular-type-enum): remove chore type * feat(config-angular): disallow subject with uppercase first character * fix(core): interprete array values for subject-case correctly * test: adapt to new angular rules BREAKING CHANGE TL;DR * chore is no longer a valid commit type * subject with leading capitalized letter are forbidden now Angular has removed the chore type from their conventions as of January 2017 See angular/angular@dff6ee3#diff-6a3371457528722a734f3c51d9238c13L204 for reference This removes the previous chore type from the list of allowed types. Projects using the Angular commit convention will identify commits with chore type as faulty. Also, formerly working commit messages are now considered problems: * type: SOME MESSAGE * type: SomeMessage * type: Some Message
- Loading branch information
Showing
37 changed files
with
242 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# @commitlint/config-angular-type-enum | ||
|
||
Shareable `commitlint` config enforcing the angular commit convention types. | ||
Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli). | ||
|
||
See [@commitlint/config-angular](../config-angular) for full angular conventions. | ||
|
||
## Getting started | ||
|
||
```sh | ||
npm install --save-dev @commitlint/config-angular-types @commitlint/cli | ||
echo "module.exports = {extends: ['@commitlint/config-angular-type-enum']};" > commitlint.config.js | ||
``` | ||
|
||
## Usage | ||
|
||
```sh | ||
echo "foo: bar" | commitlint # fails | ||
echo "build: bar" | commitlint # passes | ||
``` | ||
|
||
## Examples | ||
|
||
```js | ||
// commitlint.config.js | ||
const types = require("@commitlint/config-angular-type-enum"); | ||
|
||
// Use as rule creating errors for non-allowed types | ||
module.exports = { | ||
rules: { | ||
...types.rules | ||
} | ||
}; | ||
|
||
// Warn for non-allowed types | ||
module.exports = { | ||
rules: { | ||
'type-enum': [1, 'always', types.values()] | ||
} | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const types = [ | ||
'build', | ||
'ci', | ||
'docs', | ||
'feat', | ||
'fix', | ||
'perf', | ||
'refactor', | ||
'revert', | ||
'style', | ||
'test' | ||
]; | ||
|
||
module.exports.rules = { | ||
'type-enum': [2, 'always', types] | ||
}; | ||
|
||
module.exports.value = () => types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "@commitlint/config-angular-type-enum", | ||
"version": "4.3.0", | ||
"description": "Shareable commitlint config enforcing the angular commit convention types", | ||
"scripts": { | ||
"clean": "exit 0", | ||
"pretest": "dep-check", | ||
"start": "exit 0", | ||
"test": "exit 0" | ||
}, | ||
"xo": false, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/marionebl/commitlint.git" | ||
}, | ||
"keywords": [ | ||
"conventional-changelog", | ||
"commitlint", | ||
"commitlint-config", | ||
"angular" | ||
], | ||
"author": "Mario Nebl <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/marionebl/commitlint/issues" | ||
}, | ||
"homepage": "https://github.com/marionebl/commitlint#readme", | ||
"devDependencies": { | ||
"@commitlint/utils": "^4.2.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,20 @@ | ||
const typeEnum = require('@commitlint/config-angular-type-enum'); | ||
|
||
module.exports = { | ||
rules: { | ||
'body-leading-blank': [1, 'always'], | ||
'footer-leading-blank': [1, 'always'], | ||
'header-max-length': [2, 'always', 72], | ||
'scope-case': [2, 'always', 'lowerCase'], | ||
'scope-case': [2, 'always', 'lower-case'], | ||
'subject-case': [ | ||
2, | ||
'never', | ||
['sentence-case', 'start-case', 'pascal-case', 'upper-case'] | ||
], | ||
'subject-empty': [2, 'never'], | ||
'subject-full-stop': [2, 'never', '.'], | ||
'type-case': [2, 'always', 'lowerCase'], | ||
'type-case': [2, 'always', 'lower-case'], | ||
'type-empty': [2, 'never'], | ||
'type-enum': [ | ||
2, | ||
'always', | ||
[ | ||
'build', | ||
'chore', | ||
'ci', | ||
'docs', | ||
'feat', | ||
'fix', | ||
'perf', | ||
'refactor', | ||
'revert', | ||
'style', | ||
'test' | ||
] | ||
] | ||
'type-enum': typeEnum.rules['type-enum'] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ module.exports = { | |
'always', | ||
[ | ||
'build', | ||
'chore', | ||
'ci', | ||
'docs', | ||
'feat', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.