diff --git a/core/scripts/dev/commit-code-check.sh b/core/scripts/dev/commit-code-check.sh index 3977728c29..fb7d7bb7f1 100755 --- a/core/scripts/dev/commit-code-check.sh +++ b/core/scripts/dev/commit-code-check.sh @@ -10,10 +10,10 @@ # - Spell checking. # - File modes. # - No changes to core/node_modules directory. -# - PHPCS checks php and yaml files. -# - Eslint checks javascript files. +# - PHPCS checks PHP and YAML files. +# - Eslint checks JavaScript files. # - Checks .es6.js and .js files are equivalent. -# - Stylelint checks css files. +# - Stylelint checks CSS files. # - Checks .pcss.css and .css files are equivalent. # cSpell:disable @@ -155,7 +155,7 @@ STAT="$(stat -c "%a" $FILE 2>/dev/null)" fi if [ "$STAT" -ne "644" ]; then - printf "${red}git pre-commit check failed:${reset} file $FILE should be 644 not $STAT\n" + printf "${red}check failed:${reset} file $FILE should be 644 not $STAT\n" STATUS=1 fi fi @@ -163,13 +163,13 @@ # Don't commit changes to vendor. if [[ "$FILE" =~ ^vendor/ ]]; then - printf "${red}git pre-commit check failed:${reset} file in vendor directory being committed ($FILE)\n" + printf "${red}check failed:${reset} file in vendor directory being committed ($FILE)\n" STATUS=1 fi # Don't commit changes to core/node_modules. if [[ "$FILE" =~ ^core/node_modules/ ]]; then - printf "${red}git pre-commit check failed:${reset} file in core/node_modules directory being committed ($FILE)\n" + printf "${red}check failed:${reset} file in core/node_modules directory being committed ($FILE)\n" STATUS=1 fi @@ -192,7 +192,7 @@ ### JAVASCRIPT FILES ############################################################################ if [[ -f "$TOP_LEVEL/$FILE" ]] && [[ $FILE =~ \.js$ ]] && [[ ! $FILE =~ ^core/tests/Drupal/Nightwatch ]] && [[ ! $FILE =~ ^core/assets/vendor/jquery.ui/ui ]]; then - # Work out the root name of the Javascript so we can ensure that the ES6 + # Work out the root name of the JavaScript so we can ensure that the ES6 # version has been compiled correctly. if [[ $FILE =~ \.es6\.js$ ]]; then BASENAME=${FILE%.es6.js} @@ -325,8 +325,8 @@ fi if [[ -f "$TOP_LEVEL/$FILE" ]] && [[ $FILE =~ \.css$ ]] && [[ -f "core/node_modules/.bin/stylelint" ]]; then BASENAME=${FILE%.css} - # We only need to use stylelint on the .pcss.css file. So if this css file - # has a corresponding .pcss don't do styleint. + # We only need to use stylelint on the .pcss.css file. So if this CSS file + # has a corresponding .pcss don't do stylelint. if [[ $FILE =~ \.pcss\.css$ ]] || [[ ! -f "$TOP_LEVEL/$BASENAME.pcss.css" ]]; then cd "$TOP_LEVEL/core" node_modules/.bin/stylelint "$TOP_LEVEL/$FILE" @@ -341,7 +341,7 @@ if [[ "$STATUS" == "1" ]]; then FINAL_STATUS=1 - # There is no need to print a failure note the fail will be described + # There is no need to print a failure message. The fail will be described # already. else printf "%s ${green}passed${reset}\n" "$FILE"