doorstop
doorstop copied to clipboard
Plugin system?
In https://github.com/jacebrowning/doorstop/issues/375, I discussed the idea of a plugin system to call validation hooks automatically.
One way this could be implemented is to have Doorstop look for doorstop_hooks.py
in the root of a project and pass callbacks into Tree.validate()
automatically if functions matching a certain naming convention (e.g. "check_document" and "check_item") are defined.
What do others think?
I would generalize this plugin system a bit. It should be possible to register custom commands via sub-parsers in main() in doorstop/cli/main.py. The problem is that we have to find the project root before the sub-parsers are registered. I would place the plugin configuration in the .doorstop.yml of the top level document, e.g.
plugins:
- path/to/plugin-0.py
- path/to/plugin-1.py