-
Notifications
You must be signed in to change notification settings - Fork 88
/
composer.json
71 lines (71 loc) · 2.02 KB
/
composer.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
"name": "brainmaestro/composer-git-hooks",
"description": "Easily manage git hooks in your composer config",
"type": "library",
"minimum-stability": "stable",
"license": "MIT",
"keywords": [
"git",
"hook",
"composer"
],
"authors": [
{
"name": "Ezinwa Okpoechi",
"email": "brainmaestro@outlook.com"
}
],
"require": {
"php": "^8.0",
"symfony/console": "^5.0|^6.0|^7.0"
},
"require-dev": {
"phpunit/phpunit": "^9|^10|^11",
"friendsofphp/php-cs-fixer": "^3.0",
"ext-json": "*"
},
"autoload": {
"psr-4": {
"BrainMaestro\\GitHooks\\": "src/"
},
"files": [
"src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"BrainMaestro\\GitHooks\\Tests\\": "tests/"
}
},
"bin": [
"cghooks"
],
"scripts": {
"test": "vendor/bin/phpunit",
"post-install-cmd": "./cghooks add --ignore-lock",
"post-update-cmd": "./cghooks update",
"check-style": "php-cs-fixer fix --using-cache=no --diff --dry-run .",
"fix-style": "php-cs-fixer fix --using-cache=no ."
},
"scripts-descriptions": {
"test": "Run all tests.",
"check-style": "Run style checks (only dry run - no fixing!).",
"fix-style": "Run style checks and fix violations."
},
"extra": {
"hooks": {
"pre-commit": "composer check-style",
"pre-push": [
"composer test",
"appver=$(grep -o -E '[0-9]+\\.[0-9]+\\.[0-9]+(-alpha\\.[0-9]+)?' cghooks)",
"tag=$(git tag | tail -n 1)",
"tag=${tag#v}",
"if [ \"$tag\" != \"$appver\" ]; then",
"echo \"The most recent tag $tag does not match the application version $appver\\n\"",
"sed -i -E \"s/$appver/$tag/\" cghooks",
"exit 1",
"fi"
]
}
}
}