https://github.com/shaleh/copyright-tools
Tools for updating copyrights in files
https://github.com/shaleh/copyright-tools
automation git python
Last synced: 2 months ago
JSON representation
Tools for updating copyrights in files
- Host: GitHub
- URL: https://github.com/shaleh/copyright-tools
- Owner: shaleh
- License: mit
- Created: 2016-01-11T23:04:13.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-03-03T06:30:41.000Z (over 2 years ago)
- Last Synced: 2025-01-27T18:09:43.335Z (over 1 year ago)
- Topics: automation, git, python
- Language: Python
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Copyright Tools
== Available Tools
=== tools/update_copyright_year.py
Use the name provided by --copyright-name to find the appropriate copyright
line and update its year.
update_copyright_year.py --copyright-name "Foo Corp, Inc." *.py
Will find a line like:
# Copyright (c) 2015 Foo Corp, Inc.
and update it to be:
# Copyright (c) 2015-2016 Foo Corp, Inc.
Only comment lines are checked. Right now the assumption is that '#' or ';'
marks a comment.
=== tools/update_copyright_name.py
Replaced --old-copyright with --new-copyright in the files specified.
update_copyright_name.py --old-copyright "Foo Corp, Inc." --new-copyright "Bar Corp, Inc."
Will find a line like:
# Copyright (c) 2015 Foo Corp, Inc.
and update it to be:
# Copyright (c) 2015 Bar Corp, Inc.
Only comment lines are checked. Right now the assumption is that '#' or ';'
marks a comment.
=== helpers/pre-review This is a hook intended for use with 'git review'.
Put it in ~/.config/git-review/hooks/pre-review and chmod +x it.
This will run update_copyright_year on all of the files in the current commit
that is about to be reviewed.
== Hacking
=== Tests
- ``./setup-tests.sh`` creates the virtualenv's you need.
- ``./run-tests.sh`` will run them. TEST_ENV= controls which env to run.
- ``./cleanup-tests.sh`` for when you are done
Issues or pull requests welcomed.