mirror of
https://github.com/VisActor/VTable
synced 2024-11-21 17:40:10 +00:00
Merge pull request #2 from VisActor/chore_pre_commit
chore: add commitlint and pre-commit
This commit is contained in:
commit
9af9310599
5
.gitignore
vendored
5
.gitignore
vendored
@ -93,4 +93,7 @@ common/autoinstallers/*/.npmrc
|
||||
# packages/vtable-docs/public/css
|
||||
packages/vtable-docs/public/zh/documents
|
||||
packages/vtable-docs/public/en/documents
|
||||
packages/vtable-docs/public/*.html
|
||||
packages/vtable-docs/public/*.html
|
||||
|
||||
#git-hook
|
||||
common/scripts/pre-commit
|
@ -1,3 +1,22 @@
|
||||
module.exports = {
|
||||
extends: ["@commitlint/config-conventional"],
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
rules: {
|
||||
'not-allowed-chars': [2, 'always']
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
rules: {
|
||||
'not-allowed-chars': params => {
|
||||
const { raw } = params;
|
||||
const reg =
|
||||
/^[a-zA-Z0-9\s`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/im;
|
||||
|
||||
return [
|
||||
reg.exec(raw),
|
||||
'Your commit message should only contain english characters, numbers, empty space, and special characters.'
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
@ -1,3 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
node common/scripts/install-run-rush.js lint-staged || exit $? #++
|
||||
node common/scripts/install-run-rush.js lint-staged || exit $? #++
|
||||
|
||||
if [ -f "common/scripts/pre-commit" ]; then
|
||||
common/scripts/pre-commit
|
||||
fi
|
Loading…
Reference in New Issue
Block a user