Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add 'demo' type to commit messages (#3590)
- Loading branch information
1 parent
42642ac
commit 2e0918a
Showing
2 changed files
with
26 additions
and
9 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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
const fs = require('fs'); | ||
const angularTypes = require('@commitlint/config-angular-type-enum').value(); | ||
|
||
/* | ||
Let's get widget names as valid list of scopes. | ||
Adding also demo & demos as valid too. | ||
*/ | ||
const scopes = [ | ||
"demo", "demos", ...fs.readdirSync("./src", {withFileTypes: true}) | ||
.filter(d => d.isDirectory()) | ||
.filter(d => !["test", "util"].includes(d.name)) | ||
.map(d => d.name) | ||
...fs.readdirSync("./src", {withFileTypes: true}) | ||
.filter(d => d.isDirectory()) | ||
.filter(d => !["test", "util"].includes(d.name)) | ||
.map(d => d.name) | ||
]; | ||
|
||
const types = ['demo', ...angularTypes]; | ||
|
||
module.exports = { | ||
extends: ['@commitlint/config-angular'], | ||
rules: {"scope-enum": [2, 'always', scopes]} | ||
rules: { | ||
"scope-enum": [2, 'always', scopes], | ||
"type-enum": [2, 'always', types] | ||
} | ||
}; |