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
4 changes: 2 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ extends:
- prettier

globals:
OC:
t:
OC: readonly
t: readonly

rules:
no-plusplus:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cookbook.tar.gz
.idea/

/.php-cs-fixer.cache
/.eslintcache

# Built js package
js/*
Expand Down
16 changes: 1 addition & 15 deletions .hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -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
33 changes: 33 additions & 0 deletions .hooks/pre-push
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down