splotches / php-composter-phpmd
Automatically install a git pre-commit hook to check your PHP files upon each commit to make sure they follow the rules defined in phpmd.xml.
Installs: 26
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:php-composter-action
Requires
- eloquent/pathogen: ^0.6.1
- php-composter/php-composter: ^0.3.3
- phpmd/phpmd: ^2.6
- symfony/process: ^4.1
This package is auto-updated.
Last update: 2025-03-01 00:24:46 UTC
README
Automatically install a git pre-commit hook to check your PHP files upon each commit to make sure they follow the rules defined in phpmd.xml
.
Table Of Contents
Installation
Add as a development requirement to your composer.json
:
composer require --dev pascal-splotches/php-composter-phpmd
Usage
It automatically works whenever you execute a git commit
.
Configuration
You need to add a configuration section to your phpmd.xml
ruleset with the correct flags and paths:
<configuration> <!-- Required --> <source> <path>src</path> <!-- <path></path>... --> </source> <!-- Optional --> <exclude> <path>docs</path> <!-- <path></path>... --> </exclude> <!-- Required --> <output mode="text"/> <!-- Optional --> <minimum-priority value="5"/> <report file="report.txt"/> <!-- Optional --> <suffixes> <suffix>php</suffix> <!-- <suffix></suffix>... --> </suffixes> <!-- Optional --> <strict/> </configuration>
Built With
Contributing
All feedback, bug reports and pull requests are welcomed.
Versioning
We use SemVer for versioning. For the versions available, see the releases on this repository.
Authors
- Pascal Scheepers pascal@splotch.es
License
This project is licensed under the GPL v3 License - see the LICENSE file for details.