зеркало из https://github.com/nextcloud/cookbook.git
Merge pull request #851 from nextcloud/maintenance/git-hooks
Split checking hooks into commit and push
This commit is contained in:
Коммит
9574643cb5
|
@ -11,8 +11,8 @@ extends:
|
|||
- prettier
|
||||
|
||||
globals:
|
||||
OC:
|
||||
t:
|
||||
OC: readonly
|
||||
t: readonly
|
||||
|
||||
rules:
|
||||
no-plusplus:
|
||||
|
|
|
@ -8,6 +8,7 @@ cookbook.tar.gz
|
|||
.idea/
|
||||
|
||||
/.php-cs-fixer.cache
|
||||
/.eslintcache
|
||||
|
||||
# Built js package
|
||||
js/*
|
||||
|
|
|
@ -14,20 +14,6 @@ cleanup() {
|
|||
|
||||
trap cleanup EXIT
|
||||
|
||||
if [ -e 'vendor/bin/php-cs-fixer' ]; then
|
||||
|
||||
composer cs:check || { echo "The PHP code is not validly formatted."; exit 1; }
|
||||
|
||||
fi
|
||||
|
||||
if [ -e 'node_modules/.bin/eslint' ]; then
|
||||
npm run eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; exit 2; }
|
||||
fi
|
||||
|
||||
if [ -e 'node_modules/.bin/prettier' ]; then
|
||||
npm run prettier || { echo 'The javascript code seems to be not satifying the prettier code styler.'; exit 3; }
|
||||
fi
|
||||
|
||||
if [ -e 'node_modules/.bin/stylelint' ]; then
|
||||
npm run stylelint || { echo 'The CSS code seems to be not satifying the stylelint linter.'; exit 4; }
|
||||
npm run --silent eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; exit 1; }
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
# set -x
|
||||
|
||||
lines_before=`git stash list | wc -l`
|
||||
git stash push --keep-index -q
|
||||
lines_after=`git stash list | wc -l`
|
||||
|
||||
cleanup() {
|
||||
if [ $lines_before -lt $lines_after ]; then
|
||||
git stash pop -q
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
if [ -e 'vendor/bin/php-cs-fixer' ]; then
|
||||
|
||||
composer cs:check || { echo "The PHP code is not validly formatted."; exit 1; }
|
||||
|
||||
fi
|
||||
|
||||
if [ -e 'node_modules/.bin/eslint' ]; then
|
||||
npm run eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; exit 2; }
|
||||
fi
|
||||
|
||||
if [ -e 'node_modules/.bin/prettier' ]; then
|
||||
npm run prettier || { echo 'The javascript code seems to be not satifying the prettier code styler.'; exit 3; }
|
||||
fi
|
||||
|
||||
if [ -e 'node_modules/.bin/stylelint' ]; then
|
||||
npm run stylelint || { echo 'The CSS code seems to be not satifying the stylelint linter.'; exit 4; }
|
||||
fi
|
|
@ -19,6 +19,8 @@
|
|||
[#848](https://github.com/nextcloud/cookbook/pull/848) @christianlupus
|
||||
- Update PHP CS-Fixer
|
||||
[#849](https://github.com/nextcloud/cookbook/pull/849) @christianlupus
|
||||
- Update git hooks to not delay commits too much
|
||||
[#851](https://github.com/nextcloud/cookbook/pull/851) @christianlupus
|
||||
|
||||
|
||||
## 0.9.6 - 2021-10-18
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
"prettier-fix": "npx prettier --write src",
|
||||
"stylelint": "npx stylelint src",
|
||||
"stylelint-fix": "npx stylelint --fix src",
|
||||
"eslint": "npx eslint src/**/*.{vue,js}",
|
||||
"eslint-fix": "npx eslint --fix src/**/*.{vue,js}"
|
||||
"eslint": "npx eslint --cache --cache-strategy content src/**/*.{vue,js}",
|
||||
"eslint-fix": "npx eslint --cache --cache-strategy content --fix src/**/*.{vue,js}"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
Загрузка…
Ссылка в новой задаче