Skip to content

Commit 9d1d574

Browse files
authored
Merge pull request #7 from ensi-platform/ensitech-74
Ensitech 74
2 parents 83beb78 + be0d641 commit 9d1d574

File tree

376 files changed

+777
-167311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

376 files changed

+777
-167311
lines changed

.eslintrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts/install-dependencies.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts/install-dependencies.sh

.git_hooks/pre-commit/01-lint-php.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts/lint-php.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts/php-cs-fixer.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts/composer-validate.sh

.git_hooks/pre-push/02-phpstan.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts/phpstan.sh

.git_hooks/pre-push/03-test-code.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../scripts/test-code.sh
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Validate composer.json before commit
4+
5+
ESC_SEQ="\x1b["
6+
COL_RESET=$ESC_SEQ"39;49;00m"
7+
COL_RED=$ESC_SEQ"0;31m"
8+
COL_GREEN=$ESC_SEQ"0;32m"
9+
COL_YELLOW=$ESC_SEQ"0;33m"
10+
11+
echo
12+
printf "$COL_YELLOW%s$COL_RESET\n" "Running pre-push hook: \"composer-validate\""
13+
14+
VALID=$(composer validate --strict --no-check-publish --no-check-all | grep "is valid")
15+
16+
if [ "$VALID" != "" ]; then
17+
echo "Okay"
18+
exit 0
19+
else
20+
printf "$COL_RED%s$COL_RESET\r\n" "Composer validate check failed."
21+
exit 1
22+
fi
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# - 'composer update' if changed composer.json
4+
5+
ESC_SEQ="\x1b["
6+
COL_RESET=$ESC_SEQ"39;49;00m"
7+
COL_RED=$ESC_SEQ"0;31m"
8+
COL_GREEN=$ESC_SEQ"0;32m"
9+
COL_YELLOW=$ESC_SEQ"0;33m"
10+
11+
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)"
12+
13+
check_run() {
14+
echo "$changed_files" | grep -q "$1" && echo " * changes detected in $1" && echo " * running $2" && eval "$2"
15+
}
16+
17+
check_run composer.json "composer update"
18+
exit 0

0 commit comments

Comments
 (0)