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

drupal-check conflicts with phpstan/extension-installer #251

Closed
navneet0693 opened this issue Nov 12, 2021 · 2 comments
Closed

drupal-check conflicts with phpstan/extension-installer #251

navneet0693 opened this issue Nov 12, 2021 · 2 comments

Comments

@navneet0693
Copy link

How is drupal-check installed?
This is the content of my composer.json file.

"require": {
        "drush/drush": "10.*@stable",
        "goalgorilla/open_social": "dev-feature/3162491-group-update-d9-coding-standard",
        "goalgorilla/open_social_scripts": "^2.0",
        "drupal/redis": "^1.5",
        "blackfire/php-sdk": "^v1.27.1"
    },
    "require-dev": {
        "dealerdirect/phpcodesniffer-composer-installer": "~0.7.1",
        "drupal/coder": "8.3.13",
        "drupal/composer_deploy": "^1.6",
        "drupal/core-dev": "~9.1.0",
        "drupal/devel": "4.1.1",
        "drupal/drupal-extension": "^4.1",
        "jcalderonzumba/gastonjs": "~1.2.0",
        "jcalderonzumba/mink-phantomjs-driver": "~0.3.3",
        "mglaman/drupal-check": "^1.2",
        "mglaman/phpstan-drupal": "^1.0.0",
        "mikey179/vfsstream": "^1.6",
        "phpmd/phpmd": "^2.10",
        "phpspec/prophecy-phpunit": "^2.0",
        "phpstan/extension-installer": "^1.1",
        "phpstan/phpstan-deprecation-rules": "^1.0.0",
        "slevomat/coding-standard": "^7.0",
        "squizlabs/html_codesniffer": "*",
        "symplify/easy-coding-standard": "^9.4"
    }

drupal-check is installed as a dependency to my project

Environment:

  • OS: macOS Monterey
  • PHP Version: 7.4.25
  • Drupal core: 9.1.13

Describe the bug
Command: vendor/bin/drupal-check -ad html/profiles/contrib/social

It throws me:

These files are included multiple times:
- /Users/navneet0693/Sites/drupal_social/vendor/phpstan/phpstan-deprecation-rules/rules.neon
- /Users/navneet0693/Sites/drupal_social/vendor/mglaman/phpstan-drupal/extension.neon

It can lead to unexpected results. If you're using phpstan/extension-installer, make sure you have removed corresponding neon files from your project config file.

Console output

Performing deprecation checks
Performing analysis checks
Analyzing path: /Users/navneet0693/Sites/drupal_social/html/profiles/contrib/social
Current working directory: /Users/navneet0693/Sites/drupal_social
Using Drupal root: /Users/navneet0693/Sites/drupal_social/html
Using vendor root: /Users/navneet0693/Sites/drupal_social/vendor
Assumed running as global dependency
PHPStan path: /Users/navneet0693/Sites/drupal_social/vendor/phpstan/phpstan/phpstan.phar
PHPStan configuration path: /private/var/folders/3x/3vzyt9js70g4_hwnd5642b7w0000gn/T/drupal_check_phpstan_1636719225.neon
PHPStan configuration:
parameters:
	tipsOfTheDay: false
	reportUnmatchedIgnoredErrors: false
	excludePaths:
		- */tests/Drupal/Tests/Listeners/Legacy/*
		- */tests/fixtures/*.php
		- */settings*.php
		- */node_modules/*

	ignoreErrors:
		- "#\\Drupal calls should be avoided in classes, use dependency injection instead#"
		- "#Plugin definitions cannot be altered.#"
		- "#Missing cache backend declaration for performance.#"
		- "#Plugin manager has cache backend specified but does not declare cache tags.#"
		- "#Unsafe usage of new static\\(\\)#"

	drupal:
		drupal_root: /Users/navneet0693/Sites/drupal_social/html

	level: 4
	bootstrapFiles:
		- /Users/navneet0693/Sites/drupal_social/vendor/mglaman/drupal-check/error-bootstrap.php

includes:
	- /Users/navneet0693/Sites/drupal_social/vendor/phpstan/phpstan-deprecation-rules/rules.neon
	- /Users/navneet0693/Sites/drupal_social/vendor/mglaman/phpstan-drupal/extension.neon


Executing PHPStan
These files are included multiple times:
- /Users/navneet0693/Sites/drupal_social/vendor/phpstan/phpstan-deprecation-rules/rules.neon
- /Users/navneet0693/Sites/drupal_social/vendor/mglaman/phpstan-drupal/extension.neon

It can lead to unexpected results. If you're using phpstan/extension-installer, make sure you have removed corresponding neon files from your project config file.
Finished executing PHPStan
Unlinking PHPStan configuration
Return PHPStan exit code
@mglaman
Copy link
Owner

mglaman commented Nov 12, 2021

If you're going to add phpstan/extension-installer, that's why. Either use PHPStan directly or (no more errors) or remove phpstan/extension-installer. The installer auto-configures extensions.

We could detect if that exists and make the autoconfig easier. But for now, do

composer remove -D phpstan/extension-installer

@mglaman mglaman changed the title drupal-check conflicts with mglaman/phpstan-drupal and phpstan/phpstan-deprecation-rules. drupal-check conflicts with phpstan/extension-installer Nov 12, 2021
@mglaman
Copy link
Owner

mglaman commented Nov 12, 2021

Retitled. If the extension-installer is installed, we can skip adding those configuration files.

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

No branches or pull requests

2 participants