Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes PHPStan configuration #216

Merged
merged 1 commit into from
Jun 20, 2023
Merged

Fixes PHPStan configuration #216

merged 1 commit into from
Jun 20, 2023

Conversation

justafish
Copy link
Member

No description provided.

@github-actions github-actions bot temporarily deployed to pantheon-pr-216 June 20, 2023 21:46 Destroyed
@justafish justafish merged commit 1700d07 into main Jun 20, 2023
@justafish justafish deleted the justafish/fix-phpstan branch June 20, 2023 21:57
Comment on lines -2 to +3
- vendor/lullabot/drainpipe-dev/config/phpstan.neon
- ../../../mglaman/phpstan-drupal/extension.neon
- ../../../phpstan/phpstan-deprecation-rules/rules.neon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justafish what's the reason for changing these? Will the previously shipped phpstan.neon be removed in drainpipe 4? Wondering what your recommendations are for sites that have customized this file.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justafish This change broke a site that had a phpstan.neon.dist file. Since -c is being used, this skips the default behaviour documented at https://phpstan.org/config-reference:

If you do not provide a config file explicitly, PHPStan will look for files named phpstan.neon, phpstan.neon.dist, or phpstan.dist.neon in the current directory.

Two thoughts:

  1. Could we instead copy to phpstan.neon.dist? That would reserve phpstan.neon for locals and other customized environments, matching phpunit behaviour.
  2. If phpstan.neon(.dist) has been excluded form the scaffold via composer.json, then should we just abort the test with a warning and say "phpstan isn't configured"? I'm trying to figure out why the default case here would be triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants