-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathphpcs.sh
executable file
·46 lines (38 loc) · 1.22 KB
/
phpcs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env sh
echo "Source: https://github.com/exakat/php-static-analysis-tools \n";
VENDOR_DIR="vendor"
VENDOR_BIN_DIR="vendor/bin"
#MODULE="public_preview"
DIR_TO_CHECK="web/modules/custom"
echo "\n\n"
echo "PHP Lint with version: ---------------"
php --version
echo "\n"
${VENDOR_BIN_DIR}/parallel-lint ${DIR_TO_CHECK}
echo "\n\n";
echo "PHPCS / Drupal+Practice+Compatibility7.2+)";
${VENDOR_BIN_DIR}/phpcs --standard=phpcs.xml "${DIR_TO_CHECK}" && echo "PHPCS: No error" || echo "PHPCS: Error"
#phpcbf --standard=phpcs.xml "${DIR_TO_CHECK}"
#d
#echo "\n\n"
#echo "PHPMD ----------------------------\n\n"
#
## Removed: controversial [camelCase stuff]
#STANDARDS="cleancode,codesize,naming,design,unusedcode"
## Don't care about camelCase stuff.
#phpmd "$DIR_TO_CHECK" text "$STANDARDS" --suffixes=php,module,inc,install,test,profile,theme --strict
#
#echo "\n\n"
#echo "PHP Copy Paste Detector ----------------------------\n\n"
#
#NAMES="*.php,*.module,*.module,*.theme,*.profile,*.inc,*.test"
#phpcpd --names "$NAMES" "$DIR_TO_CHECK"
#
#echo "\n\n"
#echo "PHP LOC ----------------------------\n\n"
#
#phploc --names "$NAMES" "$DIR_TO_CHECK"
#
#echo "\n\n"
#echo "PHP Metrics ----------------------------\n\n"
#phpmetrics "$DIR_TO_CHECK"