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

Error: Configuration parameters excludes_analyse and excludePaths cannot be used at the same time #233

Closed
stef-van-looveren opened this issue Jul 19, 2021 · 18 comments · Fixed by #235

Comments

@stef-van-looveren
Copy link

How is drupal-check installed?
drupal-check is installed as a dependency on my project

Environment:

  • OS: Linux
  • PHP Version: 7.4
  • Drupal core: 9.2

Describe the bug
I get the following error when trying out drupal-check. Drupal-check does not work anymore now. I guess it is coming from PHPStan.

Console output

bash$  drupal-check -a web/modules/custom/
Configuration parameters excludes_analyse and excludePaths cannot be used at the same time.

Parameter excludes_analyse has been deprecated so use excludePaths only from now on.
@hamrant
Copy link

hamrant commented Jul 19, 2021

Same for me

Configuration parameters excludes_analyse and excludePaths cannot be used at the same time.

Parameter excludes_analyse has been deprecated so use excludePaths only from now on.

@stef-van-looveren
Copy link
Author

See mglaman/phpstan-drupal#193 (comment)

@SOMERSOFTAndrewCrook
Copy link

It could be that there is a mixture of the two configuration parameters in the files? For example in web/modules/contrib/upgrade_status/deprecation_testing.neon

	# FROM mglaman/drupal-check/phpstan/base_config.neon
	reportUnmatchedIgnoredErrors: false
	excludes_analyse:
		- */tests/Drupal/Tests/Listeners/Legacy/*
		- */tests/fixtures/*.php
		- */settings*.php
"drupal/upgrade_status": "3.4.0",

See https://www.drupal.org/project/upgrade_status/issues/3224167 for the fix for above.

@SOMERSOFTAndrewCrook
Copy link

Another place that can cause above is is the use of drupal/coder. See
https://github.com/pfrenssen/coder/blob/8.3.x/phpstan.neon

@mglaman
Copy link
Owner

mglaman commented Jul 19, 2021

Ah! Drupal Check needs to be updated for this in its generated runtime

@mglaman
Copy link
Owner

mglaman commented Jul 19, 2021

Tests are running. I'll probably need to bump the min phpstan version as well

@hamrant
Copy link

hamrant commented Jul 20, 2021

Yesterday fixed with versions hardcode - #233 (comment)

Today got a new error 🤦‍♂️

Invalid configuration:

Unexpected option 'parameters › excludePaths'.

@hamrant
Copy link

hamrant commented Jul 20, 2021

Update to https://github.com/mglaman/drupal-check/releases/tag/1.1.9 fixed problem

@mglaman, thanks a lot!

@ericalvaresnl
Copy link

Tests are running. I'll probably need to bump the min phpstan version as well

Well, phpstan-drupal version 0.12.11 is really needed in order not to break drupal-check when updating to 1.1.9.

@seismicmike
Copy link

seismicmike commented Jul 21, 2021

I've updated to drupal-check 1.1.9 and I'm still seeing this error with phpstan 0.12.92. I tried rolling phpstan back to 0.12.11, but it conflicts with another package, so I couldn't do it.

@seismicmike
Copy link

Clarification: mglaman/phpstan-drupal is at 0.12.11. phpstan/phpstan is at 0.12.92. mglaman/drupal-check is at 1.1.9, and drupal/ugprade_status is at 3.8.0. Both Upgrade Status and Drupal Check threw the same error for me yesterday until I upgraded. The upgrade fixed both, but now this morning, the error is back.

@hamrant
Copy link

hamrant commented Jul 21, 2021

These versions works for me:

        "mglaman/drupal-check": "1.1.9",
        "mglaman/phpstan-drupal": "0.12.11",
        "phpstan/phpstan": "0.12.93",

@seismicmike
Copy link

Thanks @hamrant. I'll give it a try.

@mglaman
Copy link
Owner

mglaman commented Jul 21, 2021

@ericalvaresnl yeah, that's what the last release of drupal-check did, is bump the minimum required version of phpstan-drupal.

You shouldn't need to do anything else than upgrade drupal-check

@seismicmike
Copy link

seismicmike commented Jul 21, 2021

It's working now. I had to remove all related packages, clear composer cache, and then re-install, but it's working now. So something weird must have happened on my machine.

@ericalvaresnl
Copy link

@ericalvaresnl yeah, that's what the last release of drupal-check did, is bump the minimum required version of phpstan-drupal.

You shouldn't need to do anything else than upgrade drupal-check

I see the change in the lock file, but in composer.json only xdebug-handler has changed requirements. It's still ^0.12.8 for phpstan-drupal...

@mglaman
Copy link
Owner

mglaman commented Jul 22, 2021

@ericalvaresnl 🤦 oof. You're rignt. I messed that one up.

@mglaman
Copy link
Owner

mglaman commented Jul 22, 2021

Okay, this PR fixed the composer.json: #238

New release to really fix this issue: https://github.com/mglaman/drupal-check/releases/tag/1.1.10

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