Allow for running PHPStan on test files and not

...ignoring them within the PHPStan configuration file
This commit is contained in:
Oliver Davies 2023-11-28 13:31:23 +00:00
parent 7c17007d84
commit 87c2f2e496
3 changed files with 7 additions and 0 deletions
resources
src/DataTransferObject
templates/drupal

View file

@ -2,6 +2,7 @@ drupal:
docroot: web
experimental:
runStaticAnalysisOnTests: false
useNewDatabaseCredentials: true
project_root: /app

View file

@ -120,6 +120,10 @@ final class Config
new Assert\Type('bool'),
]),
'runStaticAnalysisOnTests' => new Assert\Optional([
new Assert\Type('bool'),
]),
// TODO: remove this when its been removed from all `build.yaml` files.
'useNewDatabaseCredentials' => new Assert\Optional([
new Assert\Type('bool'),

View file

@ -2,9 +2,11 @@
parameters:
level: {{ php.phpstan.level }}
{% if not experimental.runStaticAnalysisOnTests %}
excludePaths:
- *Test.php
- *TestBase.php
{% endif %}
paths:
{% for path in php.phpstan.paths -%}
- {{ path }}