Skip to content
Snippets Groups Projects
Commit 7ab83718 authored by catch's avatar catch
Browse files

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

parent bb973f7f
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment