Skip to content

Commit ae98e09

Browse files
dbosenmtodor
authored andcommitted
Fix return value for DrupalPractice error (#6)
1 parent 70bcb5e commit ae98e09

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

scripts/check-guidelines.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ ESLINT_EXIT_STATUS=0
1313
CODER_CHECK=0
1414
CODER_DISPLAY_OPTION="--report=summary"
1515
CODER_AUTO_CORRECT=0
16-
CODER_EXIT_STATUS=0
16+
CODER_EXIT_STATUS_DRUPAL=0
17+
CODER_EXIT_STATUS_DRUPAL_PRACTICE=0
1718
CODER_IGNORE_PATTERNS="--ignore=*/vendor/*,*/docroot/*,*/libraries/*,*.md,thunder.info.yml"
1819

1920
MAKE_INIT=0
@@ -207,10 +208,11 @@ if [ $CODER_CHECK == 1 ]; then
207208

208209
# check best Drupal coding standard - this option will defined exit status
209210
phpcs -p --standard=Drupal --extensions=php,module,inc,install,test,profile,theme $CODER_DISPLAY_OPTION $CODER_IGNORE_PATTERNS $CHECK_DIR
210-
CODER_EXIT_STATUS=$?
211+
CODER_EXIT_STATUS_DRUPAL=$?
211212

212213
# check best Drupal practices coding standard
213214
phpcs -p --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme $CODER_DISPLAY_OPTION $CODER_IGNORE_PATTERNS $CHECK_DIR
215+
CODER_EXIT_STATUS_DRUPAL_PRACTICE=$?
214216
fi
215217

216218
if [ $ESLINT_CHECK == 1 ]; then
@@ -224,7 +226,7 @@ if [ $ESLINT_CHECK == 1 ]; then
224226
ESLINT_EXIT_STATUS=$?
225227
fi
226228

227-
if [ $CODER_EXIT_STATUS -ne 0 ] || [ $ESLINT_EXIT_STATUS -ne 0 ]; then
229+
if [ $CODER_EXIT_STATUS_DRUPAL -ne 0 ] || [ $CODER_EXIT_STATUS_DRUPAL_PRACTICE -ne 0 ] || [ $ESLINT_EXIT_STATUS -ne 0 ]; then
228230
echo "\033[1m\033[31m=== Some Coding styles have to be corrected to fulfill Thunder code style guidelines ===\033[0m"
229231

230232
exit 1

0 commit comments

Comments
 (0)