diff --git a/config.dist b/config.dist index 195ca3f..dfef01f 100644 --- a/config.dist +++ b/config.dist @@ -21,3 +21,9 @@ PHPCS_IGNORE_WARNINGS=1 # encoding PHPCS_ENCODING=utf-8 + +# PHP Mess Detector output mode +PHPMD_OUTPUT_MODE=text + +# PHP Mess Detector patterns +PHPMD_PATTERNS=cleancode,codesize,controversial,design,naming,unusedcode diff --git a/pre-commit b/pre-commit index 18d1f28..99f1d33 100644 --- a/pre-commit +++ b/pre-commit @@ -16,6 +16,8 @@ PHPCS_BIN=/usr/bin/phpcs PHPMD_BIN=/usr/bin/phpmd PHPCS_CODING_STANDARD=PEAR +PHPMD_OUTPUT_MODE=text +PHPMD_PATTERNS=cleancode,codesize,controversial,design,naming,unusedcode PHPCS_IGNORE= TMP_STAGING=".tmp_staging" @@ -130,7 +132,7 @@ fi echo "" echo " :: PHP Mess Detector inspection :: " echo "" -PHPMD_OUTPUT=$($PHPMD_BIN $STAGED_FILES text cleancode,codesize,controversial,design,naming,unusedcode) +PHPMD_OUTPUT=$($PHPMD_BIN $STAGED_FILES $PHPMD_OUTPUT_MODE $PHPMD_PATTERNS) PHPMD_RETVAL=$? if [ $PHPMD_RETVAL -ne 0 ]; then