Skip to content

Commit 98834e6

Browse files
committed
Issue #3259355 by mallezie, mondrake, catch, longwave, mglaman, alexpott, xjm, daffie, Mixologic: Always do a full phpstan analysis on DrupalCI
1 parent b3de883 commit 98834e6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

phpstan-partial.neon

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Configuration file for PHPStan static code checking, see https://phpstan.org .
2-
# PHPStan is triggered on Drupal CI in commit-code-check.sh.
2+
# PHPStan with partial analysis is triggered in commit-code-check.sh.
33
includes:
44
- phpstan.neon.dist
55

66
# Do not add additional configuration to this file. This configuration exists
77
# only to allow core/scripts/dev/commit-code-check.sh to run against a subset of
88
# the codebase.
99
parameters:
10-
reportUnmatchedIgnoredErrors: false
10+
reportUnmatchedIgnoredErrors: false

scripts/dev/commit-code-check.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,17 @@ printf "\n"
216216
printf -- '-%.0s' {1..100}
217217
printf "\n"
218218

219-
# Run PHPStan on all files in one go for better performance. APCu is disabled to
220-
# ensure that the composer classmap is not corrupted.
221-
if [[ $PHPSTAN_DIST_FILE_CHANGED == "1" ]]; then
219+
# Run PHPStan on all files on DrupalCI or when phpstan files are changed.
220+
# APCu is disabled to ensure that the composer classmap is not corrupted.
221+
if [[ $PHPSTAN_DIST_FILE_CHANGED == "1" ]] || [[ "$DRUPALCI" == "1" ]]; then
222222
printf "\nRunning PHPStan on *all* files.\n"
223223
php -d apc.enabled=0 -d apc.enable_cli=0 vendor/bin/phpstan analyze --no-progress --configuration="$TOP_LEVEL/core/phpstan.neon.dist"
224224
else
225+
# Only run PHPStan on changed files locally.
225226
printf "\nRunning PHPStan on changed files.\n"
226227
php -d apc.enabled=0 -d apc.enable_cli=0 vendor/bin/phpstan analyze --no-progress --configuration="$TOP_LEVEL/core/phpstan-partial.neon" $ABS_FILES
227228
fi
229+
228230
if [ "$?" -ne "0" ]; then
229231
# If there are failures set the status to a number other than 0.
230232
FINAL_STATUS=1

0 commit comments

Comments
 (0)