tenkawa-php-language-server icon indicating copy to clipboard operation
tenkawa-php-language-server copied to clipboard

Allow to change phpstan rule level

Open akuzia opened this issue 6 years ago • 6 comments

Is it possible to analyse codebase with stan using --level argument? In many other editor extensions there is such option, but this awesome ls lacks it.

akuzia avatar Jan 10 '19 12:01 akuzia

I've personally never feel the need for it (IDE is not like CI as there's no binary result, and marking any suspicious may be useful) but I see how this can be distracting - I'll put it in the next iteration.

tsufeki avatar Jan 13 '19 21:01 tsufeki

what about config files for phpstan, it does not seem to pick up my config: phpstan.neon, but I might be mistaking

crissi avatar Sep 06 '19 22:09 crissi

Indeed, phpstan.neon is ignored, and for good reasons:

  1. Versions of phpstan used in your project and bundled in LS may be different, making config file wrong/useless.
  2. I can't include extensions "as is" - many of them rely on global state or actually load analysed code, and are therefore impossible to use in a long running process.

Phpstan levels are pretty stable in general so it may be useful to pick them from phpstan.neon, but nothing more is viable.

tsufeki avatar Sep 16 '19 18:09 tsufeki

That is unfortunate, since I am using Laravel. I also use the config from https://github.com/nunomaduro/ with phpstan vs code plugin to better match Laravel logic, but since your plugin support phpstan + other awesomeness, it would make sense me to only use that instead of phpstan vs code plugin. But right now I get way too many errors with your plugin because the neon file is not supported.

crissi avatar Sep 16 '19 19:09 crissi

@tsufeki ignoreErrors and excludes_analyse are pretty viable options, in my opinion.

akuzia avatar Nov 07 '19 08:11 akuzia

I agree with @crissi, your plugin would be awesome if it supported Larastan (https://github.com/nunomaduro/larastan). Maybe it's a good idea to open a separate issue for it?

yazeed avatar Dec 29 '19 06:12 yazeed