-
Notifications
You must be signed in to change notification settings - Fork 139
add docs for specname #252
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
Conversation
| same name as the function being decorated by ``@hookimpl`` (e.g. | ||
| ``setup_project`` in the example above). | ||
|
|
||
| *new in version 0.13.2:* |
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.
obviously, took a guess at this... feel free to directly edit this (or any other part of this PR).
goodboy
left a comment
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.
@tlambert03 thanks again for the great work!
I added a few comments. Feel free to push back if I'm being too pedantic 😉
docs/index.rst
Outdated
| .. _specname: | ||
|
|
||
| Hook implementation naming |
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.
Hmm how about Hook spec selection by name.
That or linking?
edit: or Hookspec name matching as you mentioned below?
docs/index.rst
Outdated
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| During plugin :ref:`registration <registration>`, hook implementations are | ||
| matched to a hook :ref:`specifications <specs>` in the *host* program with the |
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.
matched to a hook :ref:specifications <specs> if provided in the host..
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.
to make the sentence read a bit better, I broke into two sentences, restated that there is no string 1-1 requirement, and linked to "enforcing spec validation".
docs/index.rst
Outdated
| *new in version 0.13.2:* | ||
|
|
||
| To override the default behavior, a *hookimpl* may also be matched to a | ||
| *hookspec* in the ``host program`` with a non-matching name by using the |
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.
non-matching function name
docs/index.rst
Outdated
| To override the default behavior, a *hookimpl* may also be matched to a | ||
| *hookspec* in the ``host program`` with a non-matching name by using the | ||
| ``specname`` option. Continuing the example above, the *hookimpl* function | ||
| does not need to be named ``setup_project``: |
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.
does not need to be named setup_project but if specname="setup_project" it will be matched and checked against the setup_project hookspec.
these all work for me! thanks, added (made a slight modification to the if provided sentence... but I think it's the same sentiment). you ok with it stating new in version 0.13.2:? is that a safe assumption? (and any guesstimate about your release cycle?) |
|
test failed due to HTTP error. closing and reopening to trigger new build. |
assuming you choose to merge #251, this PR adds a section to your docs about hook implementation naming and the
specnameoption.