Skip to content
Snippets Groups Projects
Verified Commit d6ef1fa5 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3343495 by alexpott: Fix commit-code-check.sh on DrupalCI

(cherry picked from commit 65d49c9c)
parent 27c7e950
No related branches found
No related tags found
16 merge requests!8394[warning] array_flip(): Can only flip STRING and INTEGER values, when saving a non-revisionable custom content entity,!7780issue 3443822: fix for 'No route found for the specified format html. Supported formats: json, xml.',!5013Issue #3071143: Table Render Array Example Is Incorrect,!4848Issue #1566662: Update module should send notifications on Thursdays,!4792Issue #2230689: Remove redundant "Italic" style,!4220Issue #3368223: Link field > Access to internal links is not checked on display.,!3884Issue #3356842,!3870Issue #3087868,!3812Draft: Issue #3339373 by alexpott, andypost, mondrake:...,!3686Issue #3219967 against 9.5.x,!3683Issue #2939397: Clearing AliasManager cache with root path raises warning,!3543Issue #3344259: Allow ajax dialog to have focus configurable,!2205Quote all names in the regions section.,!1459Issue #3087632: menu_name max length is too long,!866Issue #2845319: The highlighting of the 'Home' menu-link does not respect query strings and fragment identifiers,!204Issue #3040556: It is not possible to react to an entity being duplicated
......@@ -72,29 +72,31 @@
green=""
reset=""
DRUPAL_VERSION=$(php -r "include 'vendor/autoload.php'; print preg_replace('#\.[0-9]+-dev#', '.x', \Drupal::VERSION);")
GIT="sudo -u www-data git"
else
red=$(tput setaf 1 && tput bold)
green=$(tput setaf 2)
reset=$(tput sgr0)
GIT="git"
fi
# Gets list of files to check.
if [[ "$BRANCH" != "" ]]; then
FILES=$(git diff --name-only $BRANCH HEAD);
FILES=$($GIT diff --name-only $BRANCH HEAD);
elif [[ "$CACHED" == "0" ]]; then
# For DrupalCI patch testing or when running without --cached or --branch,
# list of all changes in the working directory.
FILES=$(git ls-files --other --modified --exclude-standard --exclude=vendor)
FILES=$($GIT ls-files --other --modified --exclude-standard --exclude=vendor)
else
# Check staged files only.
if git rev-parse --verify HEAD >/dev/null 2>&1
if $GIT rev-parse --verify HEAD >/dev/null 2>&1
then
AGAINST=HEAD
else
# Initial commit: diff against an empty tree object
AGAINST=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
FILES=$(git diff --cached --name-only $AGAINST);
FILES=$($GIT diff --cached --name-only $AGAINST);
fi
if [[ "$FILES" == "" ]] && [[ "$DRUPALCI" == "1" ]]; then
......@@ -102,10 +104,10 @@
# need to diff against the Drupal branch or tag related to the Drupal version.
printf "Creating list of files to check by comparing branch to %s\n" "$DRUPAL_VERSION"
# On DrupalCI there's a merge commit so we can compare to HEAD~1.
FILES=$(git diff --name-only HEAD~1 HEAD);
FILES=$($GIT diff --name-only HEAD~1 HEAD);
fi
TOP_LEVEL=$(git rev-parse --show-toplevel)
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment