Tool to insert license headers at the beginning of text-based files.
Project description
Tool: insert-license-header
This python script automatically inserts your license header at the beginning of specified source code files.
Forked from Lucas-C/pre-commit-hooks and modified to realize the following behaviour:
Add argument --dynamic-years
which determines the start year of the copyright time range automatically - based on when
the file was first tracked with Git. If a start year is already present, it is not touched.
If a file is not tracked by Git, the current year is used as start year.
The end year is automatically set to the current year
(--use-current-year
is activated automatically when --dynamic-years
is present).
Include a {year_start}
and {year_end}
in your license header to use this feature.
Add argument --license-base64
to include a license not via a file but through
a base64
encoded string that is passed as a value for this argument.
Obtain your license base64
encoded string with cat LICENSE.txt | base64
.
Including a license via --license-base64 {base64string}
overrides the
--license-filepath
option.
:warning: This is not a pre-commit hook anymore. Instead, this repository contains just the base script to insert licenses in text-based files. To check out the resulting pre-commit hook, visit: TBA.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for insert_license_header-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 248f12fcd20d4139aee021bd1e564ffac09ee8471f567ec736dd6c06ae14b3d8 |
|
MD5 | d60916c4a5b2f5e9ce43dc686dbc83a6 |
|
BLAKE2b-256 | 0ab13adadf1ec9c975061c1221c35b1c7fb8cfbafd75ceceae29a8df11952dae |
Hashes for insert_license_header-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41c3b008394c93b5b6cffe83f5af6b834bd0498d659a2cc984233a445b5c57d1 |
|
MD5 | 487c20cbaa2fcee9133418d77eed058e |
|
BLAKE2b-256 | 8e19309eb08d9afff033a58d474a8dfda6750b32dac882bd86bd46365ef9169e |