Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ cleanup() {

trap cleanup EXIT

retVal=0

if [ -e 'vendor/bin/php-cs-fixer' ]; then
composer cs:check || { echo "The PHP code is not validly formatted."; (( retVal |= 1 )); }
fi

if [ -e 'node_modules/.bin/eslint' ]; then
npm run --silent eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; exit 1; }
npm run --silent eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; (( retVal |= 2 )); }
fi

exit $retVal
12 changes: 8 additions & 4 deletions .hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ cleanup() {

trap cleanup EXIT

retVal=0

if [ -e 'vendor/bin/php-cs-fixer' ]; then

composer cs:check || { echo "The PHP code is not validly formatted."; exit 1; }
composer cs:check || { echo "The PHP code is not validly formatted."; (( retVal |= 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; }
npm run eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; (( retVal |= 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; }
npm run prettier || { echo 'The javascript code seems to be not satifying the prettier code styler.'; (( retVal |= 4 )); }
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 stylelint || { echo 'The CSS code seems to be not satifying the stylelint linter.'; (( retVal |= 8 )); }
fi

exit $retVal
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
[#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
- Update git hooks to run all tests even if some fail
[#856](https://github.com/nextcloud/cookbook/pull/856) @christianlupus


## 0.9.6 - 2021-10-18
Expand Down