Skip to content
Snippets Groups Projects
Commit b3f9fff8 authored by Théodore Biadala's avatar Théodore Biadala Committed by Lee Rowlands
Browse files

Issue #3238936 by nod_: The testbot does not run ESLint on all files when...

Issue #3238936 by nod_: The testbot does not run ESLint on all files when core/.eslintrc* is changed
parent 2178a984
No related branches found
No related tags found
14 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1896Issue #2940605: Can only intentionally re-render an entity with references 20 times,!1267Issue #3238936: The testbot does not run ESLint on all files when core/.eslintrc* is changed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!512Issue #3207771: Menu UI node type form documentation points to non-existent function,!485Sets the autocomplete attribute for username/password input field on login form.,!449Issue #2784233: Allow multiple vocabularies in the taxonomy filter,!231Issue #2671162: summary text wysiwyg patch working fine on 9.2.0-dev,!43Resolve #3173180: Add UI for 'loading' html attribute to images,!30Issue #3182188: Updates composer usage to point at ./vendor/bin/composer
......@@ -110,6 +110,13 @@
# This variable will be set to one when the file core/phpcs.xml.dist is changed.
PHPCS_XML_DIST_FILE_CHANGED=0
# This variable will be set to one when one of the eslint config file is
# changed:
# - core/.eslintrc.passing.json
# - core/.eslintrc.json
# - core/.eslintrc.jquery.json
ESLINT_CONFIG_PASSING_FILE_CHANGED=0
# Build up a list of absolute file names.
ABS_FILES=
for FILE in $FILES; do
......@@ -118,6 +125,10 @@
if [[ $FILE == "core/phpcs.xml.dist" ]]; then
PHPCS_XML_DIST_FILE_CHANGED=1;
fi;
if [[ $FILE == "core/.eslintrc.json" || $FILE == "core/.eslintrc.passing.json" || $FILE == "core/.eslintrc.jquery.json" ]]; then
ESLINT_CONFIG_PASSING_FILE_CHANGED=1;
fi;
done
# Exit early if there are no files.
......@@ -182,6 +193,29 @@
else
printf "\nPHPCS: ${green}passed${reset}\n"
fi
# Add a separator line to make the output easier to read.
printf "\n"
printf -- '-%.0s' {1..100}
printf "\n"
fi
# When the eslint config has been changed, then eslint must check all files.
if [[ $ESLINT_CONFIG_PASSING_FILE_CHANGED == "1" ]]; then
cd "$TOP_LEVEL/core"
yarn run -s lint:core-js-passing "$TOP_LEVEL/core"
CORRECTJS=$?
if [ "$CORRECTJS" -ne "0" ]; then
# If there are failures set the status to a number other than 0.
FINAL_STATUS=1
printf "\neslint: ${red}failed${reset}\n"
else
printf "\neslint: ${green}passed${reset}\n"
fi
cd $TOP_LEVEL
# Add a separator line to make the output easier to read.
printf "\n"
printf -- '-%.0s' {1..100}
printf "\n"
fi
for FILE in $FILES; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment