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:
:warning: The behaviour of
--dynamic-years
changed in version1.1.0
.
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 date of the last commit that affected the file.
If an end year is already present that is in the future, don't touch it. It is, however,
incremented if it lies in the past. If the file is not tracked by Git, use the current year.
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: https://github.com/Quantco/pre-commit-insert-license
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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fca5781c668f563654cd1477e7cd99162cff013f203dbee0b3591f9c5ed2a450 |
|
MD5 | 31af0f179fce68bfde6c364e4e689ae0 |
|
BLAKE2b-256 | f1435bb3694096e8e23ee7479897eb61fab75200c5cd7b8212a6ed13ddfddacd |
Hashes for insert_license_header-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b582e10a5a69cb218c1743e712d4ec6f05c2dd6e09de79a89f113eefab3f06eb |
|
MD5 | c7d12c52ec1a521eab220d9282a8fd54 |
|
BLAKE2b-256 | 20868d0ef26b5b671f26a41d6a359e70b7743f7b02e9f7534476c0538d2b0289 |