terminal42 / contao-build-tools

This is an experimental repository to ease configuration of Deployer for terminal42 Contao websites.
3 stars 0 forks source link

Phpstan is not added as a script if none of ['./src', './tests', self::LEGACY_MODULES] exists #3

Open Shadow-Devil opened 5 months ago

Shadow-Devil commented 5 months ago

I tried to run phpstan with this Plugin but was told, that the command does not exist. This is because the command is not added if none of the expected directories existed. In particular I tried to run it inside the following repository: https://github.com/terminal42/contao-notification_center Adding ./config folder would solve this issue, but may not work for other projects.

Reference: https://github.com/terminal42/contao-build-tools/blob/0ef9d6fa90c01d3a55170efa186db11f8fcd486d/src/Composer/Plugin.php#L65-L74

Shadow-Devil commented 5 months ago

Also, if I only add ./config, any other paths that I include via ./phpstan.neon are ignored. So it would be better to add all of './library', './modules', './dca', './classes' to be analyzed or somehow make the paths configurable.

aschempp commented 5 months ago

The build-tools are designed to work for our use case out of the box, and our use case is Symfony and Composer recommendations. That's why the mentioned directories never make sense, and I don't think we want to add configuration for third-party directories that we don't use and are not recommend.

Not sure about ./config though, @Toflar didn't we just add that for Symfony .php configuration files, or maybe not for phpstan?