psalm-not-empty
psalm-not-empty copied to clipboard
Feature Request: Show code which would be altered as a plugin-specific issue
Hey there,
I'd love to use this plugin as some kind of prevention.
Recently added ForbiddenFunctions
with empty
and already report the usage of empty
.
But sadly, that does not provide a suggestion on how the code could be enhanced.
This is where this plugin could come in. I already played a little bit with plugin specific options in my plugin https://github.com/boesing/psalm-plugin-stringf#experimental which works quite well.
Would you mind adding this kind of "functionality" as an opt-in as well? Guess I can work on this once we settled on if this is something this plugin should do.
Happy to get some feedback. Thanks for your time.
Hey! I'm pretty open to improving the plugin but I didn't quite caught what you want to add exactly. Could you rephrase maybe?
When enabling this plugin, it pretty does nothing until used with psalter
.
What I was thinking about is, that in non-altering mode, psalm could report that empty
should not be used while adding an example (as if it would alter the code) as an issue.
This could be enabled via opt-in (e.g. via an attribute in the psalm.xml
) for example.
Oh right, go ahead, I should have done that from the start! No need to add an opt-in, I prefer user to suppress the error instead if they don't want it