-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update license template and instructions, and whats_new
- Loading branch information
Ariana Barzinpour
committed
May 8, 2023
1 parent
84691de
commit 08c6d70
Showing
3 changed files
with
13 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
# Applying or updating license headers | ||
|
||
To add or update license headers in this or other Open Data Cube | ||
projects, you can do the following: | ||
To add or update license headers in this or other Open Data Cube projects, you can do the following: | ||
|
||
Download the tool from [https://github.com/johann-petrak/licenseheaders](https://github.com/johann-petrak/licenseheaders) and make it executable. | ||
Ensure you have pre-commit hooks installed | ||
|
||
```bash | ||
wget https://raw.githubusercontent.com/johann-petrak/licenseheaders/master/licenseheaders.py | ||
chmod +x licenseheaders.py | ||
pre-commit install | ||
``` | ||
|
||
Change the sections on `python` files, to remove the `headerStartLine` and | ||
`headerEndLine`, like: | ||
Run the `insert-license` hook: | ||
|
||
```python | ||
"headerStartLine": "", | ||
"headerEndLine": "", | ||
```bash | ||
pre-commit run insert-license --all-files | ||
``` | ||
|
||
Run the tool: | ||
To remove the license headers, add the `--remove-header` arg to `.pre-commit-config.yaml` before running the hook. | ||
|
||
```bash | ||
python3 ./licenseheaders.py --tmpl license-template.txt --years 2015-2020 --ext py --dir datacube | ||
python3 ./licenseheaders.py --tmpl license-template.txt --years 2015-2020 --ext py --dir integration_tests | ||
python3 ./licenseheaders.py --tmpl license-template.txt --years 2015-2020 --ext py --dir tests | ||
python3 ./licenseheaders.py --tmpl license-template.txt --years 2015-2020 --ext py --dir docs | ||
python3 ./licenseheaders.py --tmpl license-template.txt --years 2015-2020 --ext py --dir examples | ||
``` | ||
To make updates to the license text, first remove the headers, then update `license-template.txt` before rerunning the hook as usual to add them back. | ||
|
||
Note that the date range is automatically updated to include the current year. | ||
|
||
See the full documentation here: [https://github.com/Lucas-C/pre-commit-hooks#insert-license](https://github.com/Lucas-C/pre-commit-hooks#insert-license) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This file is part of the Open Data Cube, see https://opendatacube.org for more information | ||
|
||
Copyright (c) ${years} ODC Contributors | ||
Copyright (c) 2015-2023 ODC Contributors | ||
SPDX-License-Identifier: Apache-2.0 |