Templates¶
Some services require templates. Here is described where they are and how to use them.
Initialize¶
To generate the initial templates, run sqa with the init
command.
If there is already a .sqa
directory, it will be backed up.
Afterwards the default templates (and default configuration) will be created.
Apply License¶
The templates for the service are within the configuration folder of sqa.
The default directory is <PROJECT ROOT>/.sqa/apply-license/templates
.
license entry for the README¶
This template is a file called license_entry_README.md
in the templates directory.
It represents the ‘license section’ in the README.md in root of the project.
You can write any plaintext in there.
It should start with a heading (no matter which size) called ‘License’ (e.g. ### Licenese
).
There are three tags, that will be replaced, while running the apply-license service:
[<YEAR>]
will be replaced by the current year, while running (UTC)[<COPYRIGHT>]
will be replaced by the copyright entry of the default scope in the config[<SCOPE>]
will be replaced by a list of all scopes in the license section of the config and a link to their corresponding license
Here is the default template.
## License
Copyright © [<YEAR>] [<COPYRIGHT>]
This work is licensed under the following license(s):
[<SCOPE>]
Please see the individual files for more accurate information.
> **Hint:** We provided the copyright and license information in accordance to the [REUSE Specification 3.0](https://reuse.software/spec/).
header¶
This are templates for the different headers depending on the license itself.
jinja2 is used to generate the headers from the template.
They are named either default.jinja2
or <spdx-identifier>.jinja2
, where spdx-identifier needs to be from this list.
All templates need to be located in <PROJECT ROOT>/.sqa/apply-license/templates/header
.
If a file falls into a scope, the header for the license of the scope will be applied.
There are four tags/code blocks that will be replaced, while running the service:
[<SOFTWARE NAME>]
will be replaced by the name of the git project[<SOFTWARE DESCRIPTION>]
will be replaced by the description entry in the configThe two statements below represent the default template and will be replaced by the copyright holder and the license identifier of the corresponding scope.