feat: config commitlint & ignore commitlint auto generated files

This commit is contained in:
appflowy 2022-02-05 16:14:15 +08:00
parent 592e91bed4
commit 0d47397851
4 changed files with 62 additions and 1 deletions

3
.gitignore vendored
View File

@ -15,3 +15,6 @@ Cargo.lock
.idea/
**/temp/**
.ruby-version
package-lock.json
yarn.lock
node_modules

32
Makefile.toml Normal file
View File

@ -0,0 +1,32 @@
[tasks.install-commitlint]
mac_alias = "install-commitlint-macos"
windows_alias = "install-commitlint-windows"
linux_alias = "install-commitlint-linux"
[tasks.install-commitlint-macos]
script = [
"""
brew install npm
yarn install
yarn husky install
""",
]
script_runner = "@shell"
[tasks.install-commitlint-windows]
script = [
"""
echo "WIP"
""",
]
script_runner = "@duckscript"
[tasks.install-commitlint-linux]
script = [
"""
sudo apt install nodejs
yarn install
yarn husky install
""",
]
script_runner = "@duckscript"

View File

@ -1 +1,20 @@
module.exports = {extends: ['@commitlint/config-conventional']}
// module.exports = {extends: ['@commitlint/config-conventional']}
module.exports = {
rules: {
'type-enum': [2, 'always', ['feat', 'refactor', 'style', 'fix', 'ci']],
'body-leading-blank': [1, 'always'],
'body-max-line-length': [2, 'always', 100],
'footer-leading-blank': [1, 'always'],
'footer-max-line-length': [2, 'always', 100],
'header-max-length': [2, 'always', 100],
'subject-case': [
2,
'never',
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'type-case': [2, 'always', 'lower-case'],
'body-case': [2, 'never', []]
},
};

7
package.json Normal file
View File

@ -0,0 +1,7 @@
{
"devDependencies": {
"@commitlint/cli": "16.1.0",
"@commitlint/config-conventional": "16.0.0",
"husky": "7.0.4"
}
}