pre-commit hook with auto install
This commit is contained in:
parent
3fca6283fe
commit
fd2241dbe4
2
.gitignore
vendored
2
.gitignore
vendored
@ -15,3 +15,5 @@ phpunit.xml
|
|||||||
/nbproject
|
/nbproject
|
||||||
.env
|
.env
|
||||||
.php_cs.cache
|
.php_cs.cache
|
||||||
|
cghooks.lock
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ before_script:
|
|||||||
- flags="-o"
|
- flags="-o"
|
||||||
- composer install $flags
|
- composer install $flags
|
||||||
|
|
||||||
script: composer run-script test
|
script: composer run-script ci
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- bash <(curl -s https://codecov.io/bash)
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
|
@ -35,14 +35,26 @@
|
|||||||
"guzzlehttp/guzzle": "^7.1",
|
"guzzlehttp/guzzle": "^7.1",
|
||||||
"phpcompatibility/php-compatibility": "*",
|
"phpcompatibility/php-compatibility": "*",
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
|
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
|
||||||
"vlucas/phpdotenv": "^5.2"
|
"vlucas/phpdotenv": "^5.2",
|
||||||
|
"brainmaestro/composer-git-hooks": "^2.8"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"cghooks": "vendor/bin/cghooks",
|
||||||
|
"post-install-cmd": "cghooks add --ignore-lock",
|
||||||
|
"post-update-cmd": "cghooks update",
|
||||||
"phpunit": "./vendor/bin/phpunit -c phpunit.xml.dist",
|
"phpunit": "./vendor/bin/phpunit -c phpunit.xml.dist",
|
||||||
"phpmd": "./vendor/bin/phpmd src text controversial,design,./phpmd.xml",
|
"phpmd": "./vendor/bin/phpmd src text controversial,design,./phpmd.xml",
|
||||||
"phpcs": "./vendor/bin/phpcs -p src --runtime-set testVersion 7.3",
|
"phpcs": "./vendor/bin/phpcs -p src --runtime-set testVersion 7.3",
|
||||||
"phpcbf": "./vendor/bin/phpcbf -p src",
|
"lint": "composer run-script phpcs && composer run-script phpmd",
|
||||||
"test": "composer run-script phpcs && composer run-script phpmd && composer run-script phpunit"
|
"ci": "composer run-script lint && composer run-script phpunit"
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"hooks": {
|
||||||
|
"pre-commit": [
|
||||||
|
"echo => Running code quality tools...",
|
||||||
|
"composer run-script lint"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
Loading…
Reference in New Issue
Block a user