-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_quality.sh
More file actions
31 lines (26 loc) · 706 Bytes
/
code_quality.sh
File metadata and controls
31 lines (26 loc) · 706 Bytes
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
if [ ! -f app/etc/env.php ]; then
echo "This is command has to be executed from the root of your Magento 2 Installation"
exit;
fi
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
CONFIGPATH=$SCRIPTPATH/config.sh
if [ -e $CONFIGPATH ]
then
. $CONFIGPATH
else
. $SCRIPTPATH/config.sample.sh
fi
CURRENT_PATH="$(pwd -P)"
SCAN_FOLDER=$1
SEVERITY=$2
MODE=$3
FULL_PATH="$CURRENT_PATH/$SCAN_FOLDER"
if [ ! -d "$FULL_PATH" ]; then
echo "Folder does not exists."
exit;
fi
if [ "$MODE" = "fix" ]; then
$PHPCBF_PATH $FULL_PATH --standard=MEQP2 --extensions=php,phtml --severity=$SEVERITY
else
$PHPCS_PATH $FULL_PATH --standard=MEQP2 --extensions=php,phtml --severity=$SEVERITY
fi