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: 24

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:php-composter-action

0.1.1 2018-09-28 12:09 UTC

This package is auto-updated.

Last update: 2024-03-29 01:17:58 UTC


README

standard-readme compliant

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

License

This project is licensed under the GPL v3 License - see the LICENSE file for details.