diff --git a/core/package.json b/core/package.json index 321ecdb74a825d89312d7cba3e0ad11d0f7c0011..42580071317c9bebe96c9c122459a0459300405e 100644 --- a/core/package.json +++ b/core/package.json @@ -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", diff --git a/core/scripts/dev/commit-code-check.sh b/core/scripts/dev/commit-code-check.sh index a22a7808afb9fbe1749ad11c6af1a8e25c27dfe3..2d47e0f950c5ddb43ec5989980907e26a4fc9c86 100755 --- a/core/scripts/dev/commit-code-check.sh +++ b/core/scripts/dev/commit-code-check.sh @@ -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