mirror of
https://github.com/VisActor/VTable
synced 2024-11-22 01:52:03 +00:00
Merge pull request #2 from VisActor/chore_pre_commit
chore: add commitlint and pre-commit
This commit is contained in:
commit
9af9310599
3
.gitignore
vendored
3
.gitignore
vendored
@ -94,3 +94,6 @@ common/autoinstallers/*/.npmrc
|
||||
packages/vtable-docs/public/zh/documents
|
||||
packages/vtable-docs/public/en/documents
|
||||
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 $? #++
|
||||
|
||||
if [ -f "common/scripts/pre-commit" ]; then
|
||||
common/scripts/pre-commit
|
||||
fi
|
Loading…
Reference in New Issue
Block a user