From ef469c662bc81e22381b89c7dee7d4e5a7046cb4 Mon Sep 17 00:00:00 2001 From: David Burns Date: Thu, 8 Aug 2024 13:09:39 -0400 Subject: [PATCH] Revert "Issue #249: Switch phpstan to include phpstan.neon.dist (#627)" This reverts commit cd5d5f6c2304a638519fdcf66a382531f37e7e1a. --- .github/workflows/TestStatic.yml | 1 - drainpipe-dev/composer.json | 3 +-- .../{scaffold/phpstan.neon.dist => config/phpstan.neon} | 4 ++-- tasks/test.yml | 8 ++++++-- 4 files changed, 9 insertions(+), 7 deletions(-) rename drainpipe-dev/{scaffold/phpstan.neon.dist => config/phpstan.neon} (66%) diff --git a/.github/workflows/TestStatic.yml b/.github/workflows/TestStatic.yml index 720eacf6..12511639 100644 --- a/.github/workflows/TestStatic.yml +++ b/.github/workflows/TestStatic.yml @@ -53,7 +53,6 @@ jobs: - name: Verify files were created run: | test -f phpcs.xml.dist - test -f phpstan.neon.dist - name: Fix settings.php run: | diff --git a/drainpipe-dev/composer.json b/drainpipe-dev/composer.json index ba06a57a..8ad414fa 100644 --- a/drainpipe-dev/composer.json +++ b/drainpipe-dev/composer.json @@ -48,8 +48,7 @@ "[web-root]/sites/sites.php": "scaffold/nightwatch/sites.php", "[project-root]/.ddev/docker-compose.selenium.yaml": "scaffold/nightwatch/docker-compose.selenium.yaml", "[project-root]/test/nightwatch/example.nightwatch.js": "scaffold/nightwatch/example.nightwatch.js", - "[project-root]/phpcs.xml.dist": "scaffold/phpcs.xml.dist", - "[project-root]/phpstan.neon.dist": "scaffold/phpstan.neon.dist" + "[project-root]/phpcs.xml.dist": "scaffold/phpcs.xml.dist" } } }, diff --git a/drainpipe-dev/scaffold/phpstan.neon.dist b/drainpipe-dev/config/phpstan.neon similarity index 66% rename from drainpipe-dev/scaffold/phpstan.neon.dist rename to drainpipe-dev/config/phpstan.neon index 6ba067ea..45ff0843 100644 --- a/drainpipe-dev/scaffold/phpstan.neon.dist +++ b/drainpipe-dev/config/phpstan.neon @@ -1,6 +1,6 @@ includes: - - ./vendor/mglaman/phpstan-drupal/extension.neon - - ./vendor/phpstan/phpstan-deprecation-rules/rules.neon + - ../../../mglaman/phpstan-drupal/extension.neon + - ../../../phpstan/phpstan-deprecation-rules/rules.neon parameters: excludePaths: diff --git a/tasks/test.yml b/tasks/test.yml index c0cff87a..e5fabfa4 100644 --- a/tasks/test.yml +++ b/tasks/test.yml @@ -92,11 +92,15 @@ tasks: - | {{ .FUNC_ENSURE_DIRS }} - | + CONFIG="phpstan.neon" + if [ ! -f phpstan.neon ]; then + CONFIG="vendor/lullabot/drainpipe/scaffold/phpstan.neon" + fi if [ "{{.format}}" == "junit" ]; then mkdir -p test_result - ./vendor/bin/phpstan analyse --error-format=junit {{.TEST_DIRS}} > test_result/phpstan.xml + ./vendor/bin/phpstan analyse --error-format=junit -c $CONFIG {{.TEST_DIRS}} > test_result/phpstan.xml else - ./vendor/bin/phpstan analyse {{.TEST_DIRS}} + ./vendor/bin/phpstan analyse -c $CONFIG {{.TEST_DIRS}} fi phpunit: desc: Runs PHPUnit