Skip to content

Fix few --use-current-year bugs#63

Merged
Lucas-C merged 1 commit intoLucas-C:masterfrom
aostrowski:master
Jan 26, 2023
Merged

Fix few --use-current-year bugs#63
Lucas-C merged 1 commit intoLucas-C:masterfrom
aostrowski:master

Conversation

@aostrowski
Copy link
Copy Markdown
Contributor

Parse end years correctly if extra spacing is used.
Stop searching for the year when the whole license header was searched.
Stop changing four digit numbers that come after the header.
Fail the check if the year update failed.
Avoid creating a range with the current year used as both start and end.
Add tests for cases when the header already contains the current year.

Copy link
Copy Markdown
Owner

@Lucas-C Lucas-C left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for coming back with some fixes!

Comment thread pre_commit_hooks/insert_license.py Outdated
Comment thread tests/resources/module_with_spaced_year_range_in_license.py
Comment thread pre_commit_hooks/insert_license.py Outdated
Comment thread pre_commit_hooks/insert_license.py
Parse end years correctly if extra spacing is used.
Stop searching for the year when the whole license header was searched.
Stop changing four digit numbers that come after the header.
Fail the check if the year update failed.
Avoid creating a range with the current year used as both start and end.
Add tests for cases when the header already contains the current year.
@aostrowski
Copy link
Copy Markdown
Contributor Author

Thanks for the excellent suggestions :) I think I addressed all of them.

@Lucas-C Lucas-C merged commit 2c6a76e into Lucas-C:master Jan 26, 2023
@Lucas-C
Copy link
Copy Markdown
Owner

Lucas-C commented Jan 26, 2023

Merged!
Good job @aostrowski, and thank you 😊

@Lucas-C
Copy link
Copy Markdown
Owner

Lucas-C commented Jan 26, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants