fix: commit git hooks checking lint
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Avoid commits to the master branch
|
||||
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
REGEX="^(master|development)$"
|
||||
# Using `--silent` helps for showing any errs in the first line of the response
|
||||
# The first line is picked up by the VS Code GIT UI popup when rc is not 0
|
||||
|
||||
if [[ "$BRANCH" =~ $REGEX ]]; then
|
||||
echo "You are on branch $BRANCH. Are you sure you want to commit to this branch?"
|
||||
echo "If so, commit with -n to bypass the pre-commit hook."
|
||||
exit 1
|
||||
if npm run --silent lint:silent ; then
|
||||
exit 0
|
||||
else
|
||||
npm run --silent lint:fix
|
||||
echo "❌ Prettier check failed! We ran lint:fix for you. Please add & commit again."
|
||||
exit 1
|
||||
fi
|
||||
|
@ -598,7 +598,7 @@
|
||||
{{ libinfo[0] ? libinfo[0].TABLE_CNT : '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr *ngIf="libinfo[0].CATALOG_CNT !== null">
|
||||
<tr *ngIf="libinfo[0].CATALOG_CNT !== null">
|
||||
<td class="m-0">CATALOG_CNT:</td>
|
||||
<td class="m-0 font-bold">
|
||||
{{ libinfo[0] ? libinfo[0].CATALOG_CNT : '' }}
|
||||
|
@ -19,7 +19,9 @@
|
||||
"lint": "npm run lint:fix",
|
||||
"lint:fix": "npx prettier --write \"client/{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\" \"client/cypress/integration/*.tests.ts\"",
|
||||
"lint:check": "npx prettier --check \"client/{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\" \"client/cypress/integration/*.tests.ts\"",
|
||||
"jo": "echo"
|
||||
"lint:silent": "npx prettier --loglevel silent --check \"client/{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,yml,md,graphql}\" \"client/cypress/integration/*.tests.ts\"",
|
||||
"jo": "echo",
|
||||
"prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks && git config core.autocrlf false || true"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
Reference in New Issue
Block a user