-
Notifications
You must be signed in to change notification settings - Fork 126
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
mark something as not a hook #249
Comments
Hi @RonnyPfannschmidt , |
@marcelotrevisani this, and we need to ignore them if they match the naming scheme but have no hook declared |
Thanks! |
an example of the porblem is demonstrated in the pytest issue - the basic problem is that when pluggy is instructed to search for hooks having a prefix, even if they are not marked explicitly as hookimpl, name clashes trigger issues - |
so basically a function named in a way that could be interpreted as unknown hook, we should be able to mark it as "certainly not a hook" as ignoring it or renaming it is still a potential time bomb |
got it! Thanks for the explanation! :) |
It looks like progress here may have stalled, so I took a crack at it. @RonnyPfannschmidt please tell me your thoughts about the draft solution in PR #447 . Am I in the ballpark? Please let me know your feedback on naming conventions, coding conventions, gotchas, or of course anything else! I don't mind nitpicks, I'd like my contribution to fit in with everything else you already have. |
I reckon this is a pytest-only problem, because pluggy requires pytest adds
Can combine with |
That would also get around the uncomfortable element in the code I'm submitting, where I catch all exceptions in order to get around some pytest weirdness. Fewer instances of 'catch all', the better for sure. If this is really of no use to any project other than pytest and it's only a workaround for people who are ignoring the correct practice of using explicit hookimpl, I can certainly see the good side of not merging this solution and closing the ticket... |
There was a time where pluggy would do prefix matching, it was deprecated and moved to pytest |
follow-up to pytest-dev/pytest#6475
sometimes naming choices/backward compatibility leave functions in a name that may inadvertent fit a plug-in system
while its easy to mark things as optional hook to hide the error, that's also a time bomb waiting for someone to create that hook
a distinct marking for "really not a hook" should resolve that more clearly
The text was updated successfully, but these errors were encountered: