mirror of
https://github.com/VisActor/VTable
synced 2024-11-23 03:45:41 +00:00
chore: add commitlint and pre-commit
This commit is contained in:
parent
20f0c38167
commit
06d2aca0db
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