Pass config
to hook handlers whenever possible
#32
Labels
enhancement
Relates to new features or improvements to existing features
tutor
Requires a change to Tutor
Context
When reacting to an action or adding to a filter, plugin authors may want to look into the Tutor configuration dictionary. Some actions and filters pass their handlers
config
as an argument, others don't.For those hooks that don't pass
config
, plugin authors could still load the config dictionary themselves in a hacky way:but this is clearly not something we want plugin authors resorting to.
I can't think of a good heuristic for whether or not a hook should pass
config
as an argument... so my gut feeling is that we should passconfig
as an argument to every single hook, in case plugin authors find it useful. (That being said, there are some hooks, likeCONFIG_DEFAULTS
, that we cannot possibly passconfig
to because the hook itself is used to buildconfig
.)My proposal
In the interest of making the Plugin API as powerful as possible (without sacrificing our ability to maintain Tutor) , I propose that the
config
argument is passed to every hook, except for those hooks which are run beforeconfig
is available.Acceptance Criteria
TBD
The text was updated successfully, but these errors were encountered: