-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: phpstan baseline - use shipmonk/phpstan-baseline-per-identifier #8844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: phpstan baseline - use shipmonk/phpstan-baseline-per-identifier #8844
Conversation
PHP format of PHPStan baseline offers IDE navigation when you click on the filename, as far as I remember that's the main advantage. I am not sure if this PR brings real value. I like Shipmonk's tools, but this one seems like an overhead without much gain. Personally I don't need splitting by issue type, as I rather don't work on fixing by type, rather by file (multiple issues in the same file and files related to it). It's an additional dependency, complicated process of dumping baseline, and information spread across multiple files. In GetResponse I created a process for splitting baseline by area, which makes more sense IMHO (well, depending on the context obviously). Thanks to that, each dev team could work on their issues easier, as they have them extracted into separate files, located in specific spaces (with ownership). That, IMHO, had real value. Splitting by issue type does not necessarily give anything like that, at least from my perspective. But I won't insist on that, if @keradus and @kubawerlos like it more, then let's do it. Personally I just don't need it. |
# Conflicts: # dev-tools/phpstan/baseline.php
I prefer php baseline for the same reason 👍
I do both. Sometimes I work on fixing a specific kind of issue, sometimes I try to solve the issues in a specific file. (I have a draft branch locally for shipmonk/phpstan-baseline-per-identifier which would group the errors per file inside the type baseline files. But it is not finished and not sure if they want that feature. I like the overview of the error types and how many errors there are in each case. Personally, it also motivates me when I see an error type that I can possibly resolve completely and the associated baseline file then disappears (like the one But I also understand your reasons. And of course there's no problem if you decide against it. |
'message' => '#^Property PhpCsFixer\\\\Console\\\\Command\\\\WorkerCommand\\:\\:\\$defaultName has no type specified\\.$#', | ||
'count' => 1, | ||
'path' => __DIR__ . '/../../../src/Console/Command/WorkerCommand.php', | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E.g. in this file all errors are very similar (command name and description).
This is more noticeable due to the separate file for this error type.
So I might have a look to see if I can find a solution for that issue. I guess there is a bc reason for these errors. So maybe the solution is to just add an ignore rule to the main phpstan config file for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no opinion on this PR.
little -0 as it's extra dependency and (for me) no gain. But also no harm (and can be merged, if approved by any reviewer).
for me it's more important to shrink the baseline than to consider which format for it to use
My experience is that this happens faster with the split files. Because it is much more motivating to be able to delete entire baseline files than to eliminate a few errors from a huge file. |
I will think about your feedback, thanks @gharlan 👍. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give it a try and see how we feel with it in some time perspective.
I suggest to use https://github.com/shipmonk-rnd/phpstan-baseline-per-identifier for the phpstan baseline.
I think the baseline is clearer this way and it's easier to see what issues there are at the moment.