Skip to content
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

Feature Request: Show code which would be altered as a plugin-specific issue #2

Open
boesing opened this issue May 25, 2022 · 3 comments

Comments

@boesing
Copy link

boesing commented May 25, 2022

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.

@orklah
Copy link
Owner

orklah commented May 26, 2022

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?

@boesing
Copy link
Author

boesing commented May 26, 2022

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.

@orklah
Copy link
Owner

orklah commented May 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants