Skip to content

Commit bfbdc56

Browse files
committed
Config variables for PHPMD
1 parent 24038a1 commit bfbdc56

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

config.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ PHPCS_IGNORE_WARNINGS=1
2121

2222
# encoding
2323
PHPCS_ENCODING=utf-8
24+
25+
# PHP Mess Detector output mode
26+
PHPMD_OUTPUT_MODE=text
27+
28+
# PHP Mess Detector patterns
29+
PHPMD_PATTERNS=cleancode,codesize,controversial,design,naming,unusedcode

pre-commit

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
PHPCS_BIN=/usr/bin/phpcs
1717
PHPMD_BIN=/usr/bin/phpmd
1818
PHPCS_CODING_STANDARD=PEAR
19+
PHPMD_OUTPUT_MODE=text
20+
PHPMD_PATTERNS=cleancode,codesize,controversial,design,naming,unusedcode
1921
PHPCS_IGNORE=
2022
TMP_STAGING=".tmp_staging"
2123

@@ -130,7 +132,7 @@ fi
130132
echo ""
131133
echo " :: PHP Mess Detector inspection :: "
132134
echo ""
133-
PHPMD_OUTPUT=$($PHPMD_BIN $STAGED_FILES text cleancode,codesize,controversial,design,naming,unusedcode)
135+
PHPMD_OUTPUT=$($PHPMD_BIN $STAGED_FILES $PHPMD_OUTPUT_MODE $PHPMD_PATTERNS)
134136
PHPMD_RETVAL=$?
135137

136138
if [ $PHPMD_RETVAL -ne 0 ]; then

0 commit comments

Comments
 (0)