Issue #3238936 by nod_: The testbot does not run ESLint on all files when core/.eslintrc* is changed
							parent
							
								
									2178a984eb
								
							
						
					
					
						commit
						b3f9fff816
					
				| 
						 | 
				
			
			@ -110,6 +110,13 @@ TOP_LEVEL=$(git rev-parse --show-toplevel)
 | 
			
		|||
# 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 @@ for FILE in $FILES; do
 | 
			
		|||
  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 @@ if [[ $PHPCS_XML_DIST_FILE_CHANGED == "1" ]]; then
 | 
			
		|||
  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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue