Skip to content

Commit

Permalink
Improve excluded files + add CaptainHook
Browse files Browse the repository at this point in the history
  • Loading branch information
iquito committed Jul 30, 2024
1 parent 605d3ef commit 09fde8f
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 10 deletions.
11 changes: 3 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
/bin export-ignore
/tests export-ignore
/tools export-ignore
/examples export-ignore
/docker export-ignore
/vendor-bin export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/captainhook.json export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/psalm-baseline.xml export-ignore
/ruleset.xml export-ignore
/captainhook.json export-ignore
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},
"require-dev": {
"captainhook/captainhook-phar": "^5.0",
"captainhook/hook-installer": "^1.0",
"phpunit/phpunit": "^11.0",
"mockery/mockery": "^1.0",
"squirrelphp/types": "^1.0",
Expand All @@ -40,7 +41,13 @@
"config": {
"sort-packages": false,
"allow-plugins": {
"captainhook/captainhook-phar": true
"captainhook/captainhook-phar": true,
"captainhook/hook-installer": true
}
},
"extra": {
"captainhook": {
"config": "tools/captainhook.json"
}
},
"autoload": {
Expand All @@ -54,6 +61,7 @@
}
},
"scripts": {
"captainhook_install": "vendor/bin/captainhook install --configuration=tools/captainhook.json --ansi --no-interaction",
"phpstan": "vendor-bin/phpstan/vendor/bin/phpstan analyse --configuration=tools/phpstan.neon",
"phpstan_full": "rm -Rf tools/cache/phpstan && vendor-bin/phpstan/vendor/bin/phpstan analyse --configuration=tools/phpstan.neon",
"phpstan_base": "vendor-bin/phpstan/vendor/bin/phpstan analyse --configuration=tools/phpstan.neon --generate-baseline=tools/phpstan-baseline.php",
Expand Down
1 change: 1 addition & 0 deletions docker/compose/composer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
driver: "none"
volumes:
- ./.editorconfig:/usr/src/app/.editorconfig
- ./.git:/usr/src/app/.git
- ./bin:/usr/src/app/bin
- ./composer.json:/usr/src/app/composer.json
- ./composer.lock:/usr/src/app/composer.lock
Expand Down
2 changes: 1 addition & 1 deletion docker/test
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ docker compose -f "$DIR/compose/test.yml" --project-directory "$DIR/.." down --v
docker compose -f "$DIR/compose/test.yml" --project-directory "$DIR/.." up --build --force-recreate --renew-anon-volumes --remove-orphans --always-recreate-deps --abort-on-container-exit --exit-code-from=test test

# Remove all running docker containers
#docker compose -f "$DIR/compose/test.yml" --project-directory "$DIR/.." down --volumes --remove-orphans
docker compose -f "$DIR/compose/test.yml" --project-directory "$DIR/.." down --volumes --remove-orphans
65 changes: 65 additions & 0 deletions tools/captainhook.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"commit-msg": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Beams",
"options": {
"subjectLength": 72,
"bodyLineLength": 72
},
"conditions": []
}
]
},
"pre-push": {
"enabled": false,
"actions": []
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting",
"options": [],
"conditions": []
},
{
"action": "docker/composer phpstan",
"options": [],
"conditions": []
},
{
"action": "docker/composer psalm",
"options": [],
"conditions": []
},
{
"action": "docker/composer phpcs",
"options": [],
"conditions": []
},
{
"action": "docker/test",
"options": [],
"conditions": []
}
]
},
"prepare-commit-msg": {
"enabled": false,
"actions": []
},
"post-commit": {
"enabled": false,
"actions": []
},
"post-merge": {
"enabled": false,
"actions": []
},
"post-checkout": {
"enabled": false,
"actions": []
}
}

0 comments on commit 09fde8f

Please sign in to comment.