Skip to content

Commit 09fde8f

Browse files
committed
Improve excluded files + add CaptainHook
1 parent 605d3ef commit 09fde8f

File tree

5 files changed

+79
-10
lines changed

5 files changed

+79
-10
lines changed

.gitattributes

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1+
/bin export-ignore
12
/tests export-ignore
3+
/tools export-ignore
24
/examples export-ignore
35
/docker export-ignore
46
/vendor-bin export-ignore
57
/.editorconfig export-ignore
68
/.gitattributes export-ignore
79
/.gitignore export-ignore
8-
/.travis.yml export-ignore
9-
/captainhook.json export-ignore
10-
/phpstan.neon export-ignore
11-
/phpstan-baseline.neon export-ignore
12-
/phpunit.xml.dist export-ignore
13-
/psalm.xml export-ignore
14-
/psalm-baseline.xml export-ignore
15-
/ruleset.xml export-ignore
10+
/captainhook.json export-ignore

composer.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
},
2626
"require-dev": {
2727
"captainhook/captainhook-phar": "^5.0",
28+
"captainhook/hook-installer": "^1.0",
2829
"phpunit/phpunit": "^11.0",
2930
"mockery/mockery": "^1.0",
3031
"squirrelphp/types": "^1.0",
@@ -40,7 +41,13 @@
4041
"config": {
4142
"sort-packages": false,
4243
"allow-plugins": {
43-
"captainhook/captainhook-phar": true
44+
"captainhook/captainhook-phar": true,
45+
"captainhook/hook-installer": true
46+
}
47+
},
48+
"extra": {
49+
"captainhook": {
50+
"config": "tools/captainhook.json"
4451
}
4552
},
4653
"autoload": {
@@ -54,6 +61,7 @@
5461
}
5562
},
5663
"scripts": {
64+
"captainhook_install": "vendor/bin/captainhook install --configuration=tools/captainhook.json --ansi --no-interaction",
5765
"phpstan": "vendor-bin/phpstan/vendor/bin/phpstan analyse --configuration=tools/phpstan.neon",
5866
"phpstan_full": "rm -Rf tools/cache/phpstan && vendor-bin/phpstan/vendor/bin/phpstan analyse --configuration=tools/phpstan.neon",
5967
"phpstan_base": "vendor-bin/phpstan/vendor/bin/phpstan analyse --configuration=tools/phpstan.neon --generate-baseline=tools/phpstan-baseline.php",

docker/compose/composer.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
driver: "none"
99
volumes:
1010
- ./.editorconfig:/usr/src/app/.editorconfig
11+
- ./.git:/usr/src/app/.git
1112
- ./bin:/usr/src/app/bin
1213
- ./composer.json:/usr/src/app/composer.json
1314
- ./composer.lock:/usr/src/app/composer.lock

docker/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ docker compose -f "$DIR/compose/test.yml" --project-directory "$DIR/.." down --v
99
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
1010

1111
# Remove all running docker containers
12-
#docker compose -f "$DIR/compose/test.yml" --project-directory "$DIR/.." down --volumes --remove-orphans
12+
docker compose -f "$DIR/compose/test.yml" --project-directory "$DIR/.." down --volumes --remove-orphans

tools/captainhook.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"commit-msg": {
3+
"enabled": true,
4+
"actions": [
5+
{
6+
"action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Beams",
7+
"options": {
8+
"subjectLength": 72,
9+
"bodyLineLength": 72
10+
},
11+
"conditions": []
12+
}
13+
]
14+
},
15+
"pre-push": {
16+
"enabled": false,
17+
"actions": []
18+
},
19+
"pre-commit": {
20+
"enabled": true,
21+
"actions": [
22+
{
23+
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting",
24+
"options": [],
25+
"conditions": []
26+
},
27+
{
28+
"action": "docker/composer phpstan",
29+
"options": [],
30+
"conditions": []
31+
},
32+
{
33+
"action": "docker/composer psalm",
34+
"options": [],
35+
"conditions": []
36+
},
37+
{
38+
"action": "docker/composer phpcs",
39+
"options": [],
40+
"conditions": []
41+
},
42+
{
43+
"action": "docker/test",
44+
"options": [],
45+
"conditions": []
46+
}
47+
]
48+
},
49+
"prepare-commit-msg": {
50+
"enabled": false,
51+
"actions": []
52+
},
53+
"post-commit": {
54+
"enabled": false,
55+
"actions": []
56+
},
57+
"post-merge": {
58+
"enabled": false,
59+
"actions": []
60+
},
61+
"post-checkout": {
62+
"enabled": false,
63+
"actions": []
64+
}
65+
}

0 commit comments

Comments
 (0)