-
Notifications
You must be signed in to change notification settings - Fork 667
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
psalm checks for InvalidDocblock in ignoreFiles directory #4975
Comments
This is expected behaviour for Psalm. What is not expected however is syntax error in dependancies' phpdoc. And I'm actually to blame for this one as i pushed a wrong PR in doctrine/orm. This was fixed here: doctrine/orm#8374 but I'm not sure this was released yet. |
Duplicate of #4265 |
@orklah hi .... why is it expected behaviour that psalm checks a file that is specifically being asked to be ignored? is there no way in the config to say "under no circumstances check files in these directories, even if a class in an unignored file references it (e.g. parent::construct)" |
@EtchAkhtar Basically Psalm has two modes when checking a file:
Everything you include in projectFiles will be analyzed, except what you put in ignoreFiles. However, you can't stop Psalm to go check at your dependancies, because if it can't, it can't work at all. For example, imagine you have a dependancy that have a method If Psalm were to add an option to absolutely not check a file, you'd just have big holes everywhere in your analysis and you wouldn't know it. |
@orklah thank you for the example, this make sense |
I've been able to work around this using a baseline file, which I think is a valid use case for that ("I won't fix now, but want it recorded, and don't want my CI to break, or to have to disable checks"). https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file |
Be warned that the issue emitted by Psalm means it wasn't able to parse the docblock. This means it will not be able to warn you if you sent a wrong type to this method or help you with the received type |
Yeah, that makes sense. I don't know of any alternative, and I think this particular issue has been fixed, so whenever 2.8.2 is released (hopefully this quarter) we can delete it. I don't think any of my code directly uses that constructor anyway, as Doctrine does that itself internally. |
psalm 4.3.2, all plugins are disabled.
I got this:
My project files in the config are defined as:
Looks like some logic checks EntityRepository class for the reason that all custom repositories (that are belongs to
<directory name="src"/>
) are extended from this class.The text was updated successfully, but these errors were encountered: