phpstan-drupal icon indicating copy to clipboard operation
phpstan-drupal copied to clipboard

Exclude build directory from discovery

Open mxr576 opened this issue 6 years ago • 4 comments

Well, this a PR that kinda solves our specific problem and it is related to: https://github.com/mglaman/drupal-check/pull/98 and https://www.drupal.org/project/drupal/issues/2943172

I understand this PR is probably not going to be merged as-is but I hope it starts a conversation about how this problem can be solved in a maintainable way (and can use this PR as a patch with Composer as a temporary fix our builds ;P)

I see that this library basically has a copy-paste of Drupal core's extension discovery with a major difference. It does not retrieve the ignored files list from Settings or from a configuration parameter: https://github.com/drupal/core/blob/8.7.6/lib/Drupal/Core/Extension/ExtensionDiscovery.php#L427

mxr576 avatar Aug 14 '19 06:08 mxr576

The setting should be moved to a extension.neon parameter.

mglaman avatar Oct 18 '19 13:10 mglaman

My other idea was using environment variables for this so the list could be extended by the runtime environment (like Docker) easily.

mxr576 avatar Oct 21 '19 05:10 mxr576

@mxr576 is this still a problem? The fix would be adding a parameter in extension.neon to make this configurable.

mglaman avatar Dec 01 '21 20:12 mglaman

Well, we switch the way we test modules in isolation, so currently it is not a blocker, but probably still a good idea making this configurable, extendible.

mxr576 avatar Dec 01 '21 21:12 mxr576

I'm going to close this. It hasn't been reported by many others. I don't want to add a parameter that could be abused as a way to avoid scanning certain modules in unsupported use cases.

mglaman avatar Feb 14 '24 02:02 mglaman