Commit d7f89c52 authored by catch's avatar catch
Browse files

Issue #3386607 by alexpott: Improve spell checking in commit-code-check.sh

(cherry picked from commit 7ab83718)
parent e7cbdb85
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
    "prettier": "prettier --write \"./**/*.js\"",
    "spellcheck": "cspell -c .cspell.json",
    "spellcheck:make-drupal-dict": "rm -f misc/cspell/dictionary.txt && touch misc/cspell/dictionary.txt && yarn -s spellcheck:core --unique --words-only | perl -Mopen=locale -pe '$_=lc$_' | LC_ALL=en_US.UTF-8 tr -d \\\\\\\\ | LC_ALL=C sort -u -o misc/cspell/dictionary.txt",
    "spellcheck:core": "cspell -c .cspell.json --no-progress --root .. \"core/**/*\" \"composer/**/*\" \"composer.json\"",
    "spellcheck:core": "cspell -c .cspell.json --root .. \"core/**/*\" \"composer/**/*\" \"composer.json\"",
    "vendor-update": "node ./scripts/js/vendor-update.js",
    "watch:ckeditor5": "webpack --config ./modules/ckeditor5/webpack.config.js --watch",
    "build:ckeditor5": "webpack --config ./modules/ckeditor5/webpack.config.js",
+6 −4
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@
    CKEDITOR5_PLUGINS_CHANGED=1;
  fi;

  if [[ $FILE == "core/misc/cspell/dictionary.txt" ]]; then
  if [[ $FILE == "core/misc/cspell/dictionary.txt" || $FILE == "core/.cspell.json" ]]; then
    CSPELL_DICTIONARY_FILE_CHANGED=1;
  fi
done
@@ -215,13 +215,15 @@
  exit 1;
fi

# Run spellcheck:core when cspell files are changed.
# Check all files for spelling in one go for better performance.
if [[ $CSPELL_DICTIONARY_FILE_CHANGED == "1" ]] ; then
  printf "\nRunning spellcheck on *all* files.\n"
  yarn run -s spellcheck:core --no-must-find-files --root $TOP_LEVEL $ABS_FILES
  yarn run -s spellcheck:core --no-must-find-files --no-progress
else
  yarn run -s spellcheck --no-must-find-files --root $TOP_LEVEL $ABS_FILES
  # Check all files for spelling in one go for better performance. We pipe the
  # list files in so we obey the globs set on the spellcheck:core command in
  # core/package.json.
  echo "${ABS_FILES}" | tr ' ' '\n' | yarn run -s spellcheck:core --no-must-find-files --file-list stdin
fi

if [ "$?" -ne "0" ]; then