-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from boxuk/git-hooks
[SETUP] Implement Git Hooks
- Loading branch information
Showing
6 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env bash | ||
docker-compose run --rm nodejs "$@" | ||
docker-compose run --rm -T nodejs "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env bash | ||
docker-compose run --rm php "$@" | ||
docker-compose run --rm -T php "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
FROM busybox:latest | ||
|
||
ENTRYPOINT sh -c "cd /tmp/hooks && ls | xargs chmod +x && cd /tmp/.git/hooks && find ../../hooks -type f -exec ln -sf {} /tmp/.git/hooks/ \; && echo 'githooks installed'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Git Hoooks | ||
|
||
These scripts run at lifecycles during git development and can be used to automate certain tasks to encourage coding standards and tests to be valid before being pushed to the remote repository. | ||
|
||
More information can be found online seraching for Git Hooks, or [here's](https://www.atlassian.com/git/tutorials/git-hooks) a good tutorial! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Pre-Commit Hook | ||
|
||
## Run Tests... | ||
|
||
### PHP | ||
echo "Running PHP Tests..." | ||
./bin/composer run phpcs | ||
./bin/composer run phpunit | ||
./bin/composer run phpstan | ||
./bin/composer run coverage-check | ||
|
||
### JS | ||
echo "Running JS Tests..." | ||
./bin/npm run lint | ||
./bin/npm run test | ||
./bin/npm run type-coverage | ||
./bin/npm run build |