SanderRonde / phpstan-vscode

PHPStan plugin for VSCode
https://marketplace.visualstudio.com/items?itemName=SanderRonde.phpstan-vscode
MIT License
40 stars 9 forks source link

Change config file resolution priority to match PHPStan #22

Closed jreklund closed 1 year ago

jreklund commented 1 year ago

Thanks for the plugin, I just tried it out. We are currently using PHPStan with GrumPHP on pre-commit but having it run instantly would be awesome. I would like to have the same config resolution priority as PHPStan.

  1. If config file is provided as a command line option, it will be used.
  2. Otherwise, if phpstan.neon exists in the current working directory, it will be used.
  3. Otherwise, if phpstan.neon.dist exists in the current working directory, it will be used.
  4. Otherwise, if phpstan.dist.neon exists in the current working directory, it will be used.
  5. If none of the above is true, no config will be used.

I tried changing phpstan.configFile into phpstan.neon,phpstan.neon.dist and phpstan.neon|phpstan.neon.dist but it doesn't seem to allow for multiple configurations. At the moment we have a dist file in the project, but we do local changes before we distribute them to the whole team.

SanderRonde commented 1 year ago

Sounds good! Will implement this in not too long. I think the format of a comma-separated list would indeed be best since it preserves the string-format for most users.

SanderRonde commented 1 year ago

Should be live now! (version 2.2.19)

jreklund commented 1 year ago

Amazing, going to try it out first thing in the morning!