From bfbdc56c2f4d86c6a699d6dd31a03ae2834cbb99 Mon Sep 17 00:00:00 2001 From: Davi Marcondes Moreira Date: Mon, 11 Apr 2016 16:45:44 -0300 Subject: [PATCH] Config variables for PHPMD --- config.dist | 6 ++++++ pre-commit | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) 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