-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support flexible years in licenses (#23) #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
This would make a useful addition to this hook 😊
Could you please also provide a usage example in the README.md
as part of this PR?
# Strict and flexible years | ||
('module_with_stale_year_in_license.py', '#', False, None, False, False), | ||
('module_with_stale_year_range_in_license.py', '#', False, None, False, False), | ||
('module_with_license.py', '#', False, 'module_without_license.py', True, True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same suggestion here: could you add a test with a badly formatted year range please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
The new flag `--use-current-year` allows automatically updating the year in copyright headers, using always the current year when inserting new ones and removing headers regardless of the years they contain.
Thanks for the review, I like the code better now. |
@@ -84,6 +85,20 @@ In case you want to remove the comment headers introduced by | |||
3. Remove the `--remove-header` arg and update your `LICENSE.txt` ; | |||
4. Re-run the hook on all your files. | |||
|
|||
#### Handling years flexibly | |||
|
|||
You can add `--use-current-year` to change how the hook treats years in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍
Merging this now! |
The new flag
--flexible-years
allows automatically updating the year in copyright headers, using always the current year when inserting new ones and removing headers regardless of the years they contain.