Insert __copyright_year
into cookiecutter.json
#46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is needed to prevent the cookiecutter from updating the copyright year in the
LICENSE
file to the current year every new year. See: hypothesis/cookiecutters#105I automated the creation of these PRs using Commando. I first created a script at
/tmp/insert_copyright_year.py
that, when run in the root directory of a project, inserts__copyright_year
into the project'scookiecutter.json
file:I then ran Commando like this to create the PRs:
Rather than typing out the long
gh api
command you can instead just call the bin/find_repos script from the cookiecutter repo, assuming you want to send PRs to all cookiecuttered projects:commando --repos $(bin/find_repos) --command ...
You can also run the same command on just one repo first in order to test it before sending loads of PRs. Just run
commando --repos hypothesis/tox-envfile --command ...
.Unfortunately there may be some incidental reformatting of
cookiecutter.json
(with no functional effect) due to rewriting the previously hand-edited file from Python.