Replies: 1 comment 1 reply
-
If I remember correctly we already tried that, but it was a bit painful to maintain the baseline. I'm OK to try again anyway.
Sometimes, fixing an error allows PHPStan to better understand a part of the code and start to detect more errors in that code, hence making the baseline grow. In this case this should be allowed, otherwise one would have to fix all newly detected errors, even if they were not actually introduced with the changes. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently we have PHPStan analysis on level 6, which is relatively low (max is 9). I believe that rising level can help with producing better code and catch more flaws. Current code on level 9 causes ~3k errors to be reported.
As a reference: in GetResponse we currently bumped level to 9 which caused 36k+ of errors to be added to baseline files. Root cause of that decision is shown here - because one error was ignored on level 6 it could lead to other problems that were reported only on level 9...
Bumping level and dumping existing errors to baseline can allow us to catch more potential issues in newly created code, while keeping existing issues as backlog to fix. We could enforce that baseline can only shrink somehow and clean it from time to time.
10 votes ·
Beta Was this translation helpful? Give feedback.
All reactions