Pre-commit Git hook: check syntax (PHP, Json, XML, Yaml)
Documentation:
- https://github.com/phpro/grumphp/blob/master/doc/tasks/phplint.md
- https://github.com/phpro/grumphp/blob/master/doc/tasks/jsonlint.md
- https://github.com/phpro/grumphp/blob/master/doc/tasks/xmllint.md
- https://github.com/phpro/grumphp/blob/master/doc/tasks/yamllint.md
Todo list:
-
pre-commit: check PHP syntax, because "Parse error: syntax error" is not allowed. -
pre-commit: check XML syntax -
pre-commit: check Json syntax -
pre-commit: check Yaml syntax
check PHP syntax
jakub-onderka/php-parallel-lint checks the syntax of PHP files, because "Parse error: syntax error" is not allowed
# install
composer require --dev jakub-onderka/php-parallel-lint
# usage
vendor/bin/parallel-lint ./src/
vendor/bin/parallel-lint ./tests/
vendor/bin/parallel-lint --exclude "vendor" .
Edited by Fabrice Gangler