Issue #3195888 by alexpott, quietone: Check dependencies are correct in core/scripts/dev/commit-code-check.sh

merge-requests/157/head
Lee Rowlands 2021-05-22 17:47:25 +10:00
parent 40dabffe25
commit 98a653c2ff
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
1 changed files with 24 additions and 1 deletions

View File

@ -123,8 +123,31 @@ fi;
# run and all dependencies are updated.
FINAL_STATUS=0
# Check all files for spelling in one go for better performance.
DEPENDENCIES_NEED_INSTALLING=0
# Ensure PHP development dependencies are installed.
# @todo https://github.com/composer/composer/issues/4497 Improve this to
# determine if dependencies in the lock file match the installed versions.
# Using composer install --dry-run is not valid because it would depend on
# user-facing strings in Composer.
if ! [[ -f 'vendor/bin/phpcs' ]]; then
printf "Drupal's PHP development dependencies are not installed. Run 'composer install' from the root directory.\n"
DEPENDENCIES_NEED_INSTALLING=1;
fi
cd "$TOP_LEVEL/core"
# Ensure JavaScript development dependencies are installed.
yarn check -s 2>/dev/null
if [ "$?" -ne "0" ]; then
printf "Drupal's JavaScript development dependencies are not installed. Run 'yarn install' inside the core directory.\n"
DEPENDENCIES_NEED_INSTALLING=1;
fi
if [ $DEPENDENCIES_NEED_INSTALLING -ne 0 ]; then
exit 1;
fi
# Check all files for spelling in one go for better performance.
yarn run -s spellcheck -c $TOP_LEVEL/core/.cspell.json $ABS_FILES
if [ "$?" -ne "0" ]; then
# If there are failures set the status to a number other than 0.