phpstan-drupal
phpstan-drupal copied to clipboard
Exclude build directory from discovery
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
The setting should be moved to a extension.neon parameter.
My other idea was using environment variables for this so the list could be extended by the runtime environment (like Docker) easily.
@mxr576 is this still a problem? The fix would be adding a parameter in extension.neon to make this configurable.
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.
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.