pre-commit-php icon indicating copy to clipboard operation
pre-commit-php copied to clipboard

Add new php-cpd commit hook

Open craig-davis opened this issue 9 years ago • 0 comments

Feature

PHP Copy Paste Detector is a QA tool that can be used to find duplicate code. This adds a new pre-commit-php hook for calling phpcpd.

Implementation

This is fairly straightforward and also follows the general pattern of php-cs-fixer. This will ONLY analyze the files that are staged for duplicate code, and not the entire project. A feature to scan the entire project could perhaps be added.

Sample Output

Sample Output

Review

This was a little rushed, and the commit to both the README and hooks files have the entries from php-md in it. This should sort itself out in the merge, but if you'd like a tidier PR, please let me know.

craig-davis avatar Dec 04 '15 02:12 craig-davis