reuse-tool
reuse-tool copied to clipboard
Allow project-external templates for `addheader`
Currently, it's only possible to refer to custom templates for addheader using templates that are within the project's .reuse/templates folder. See the current documentation here.
We want to make it possible to also load templates from other, more global places.
This could be:
- The templates could be loaded from a user's config directory like
~/.config/reuse/templates/, also referred to then asreuse addheader --template="myglobaltemplate". To support different operating systems, the appdirs library could be used. - They could also be loaded from any path, e.g.
reuse addheader --template="/my/reuse/templates"orreuse addheader --template="~/../templates" - In any case, we figured that if the value is not a path but just a name (e.g.
--template="mytemplate"), that the tool should first look for.reuse/templates/mytemplate.jinja2and only if nothing is found inmytemplate(so a relative path on the same level).
My personal expectation was that reuse would look in...
- the project's
.reuse/templates/folder - the parent directories
.reuse/templates/folder (allowing for organization grouped working directories to share configs) - my user directory space:
~/.reuse/templates/(allowing use by me across all my projects)
It looks like appdirs could provide for the third option.