forked from NationalBankBelgium/stark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(all): add commitizen + commitlint with scripts, config & depende…
…ncies fix NationalBankBelgium#290
- Loading branch information
Showing
3 changed files
with
86 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const commitLintConfig = require("./commitlint.config"); | ||
const generateScopes = () => { | ||
let rules = []; | ||
for (rule of commitLintConfig.rules["scope-enum"][2]) { | ||
rules.push({ name: rule }); | ||
} | ||
return rules; | ||
}; | ||
|
||
module.exports = { | ||
//See here for options details https://github.com/leonardoanalista/cz-customizable#options | ||
types: [ | ||
{ value: "feat", name: "feat: A new feature" }, | ||
{ value: "fix", name: "fix: A bug fix" }, | ||
{ value: "docs", name: "docs: Documentation only changes" }, | ||
{ | ||
value: "style", | ||
name: | ||
"style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)" | ||
}, | ||
{ value: "refactor", name: "refactor: A code change that neither fixes a bug nor adds a feature" }, | ||
{ value: "perf", name: "perf: A code change that improves performance" }, | ||
{ value: "test", name: "test: Adding missing tests or correcting existing tests" }, | ||
{ | ||
value: "build", | ||
name: | ||
"build: Changes that affect the build system or external dependencies\n (example scopes: gulp, broccoli, npm)" | ||
}, | ||
{ | ||
value: "ci", | ||
name: | ||
"ci: Changes to our CI configuration files and scripts\n (example scopes: Travis, Circle, BrowserStack, SauceLabs)" | ||
}, | ||
{ | ||
value: "chore", | ||
name: "chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation" | ||
}, | ||
{ value: "revert", name: "revert: Reverts a previous commit" } | ||
], | ||
scopes: generateScopes() | ||
}; |
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,32 @@ | ||
module.exports = { | ||
extends: ["@commitlint/config-conventional"], | ||
|
||
//See here for the rules definition : https://github.com/marionebl/commitlint/blob/master/docs/reference-rules.md | ||
rules: { | ||
"header-max-length": [1, "always", 100], | ||
"scope-enum": [ | ||
2, | ||
"always", | ||
[ | ||
"core", | ||
"ui", | ||
"test", | ||
"build", | ||
"accessibility", | ||
"build-main", | ||
"developer-guide", | ||
"docs", | ||
"qa", | ||
"stark-all", | ||
"stark-build", | ||
"stark-core", | ||
"stark-demo", | ||
"stark-starter", | ||
"stark-rbac", | ||
"stark-ui", | ||
"testing" | ||
] | ||
], | ||
"scope-case": [2, "always", "lowerCase"] | ||
} | ||
}; |
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