fix: gh#172 use default date values

When parsing the current version, if it doesn't
specify anyt date part, (such as is the case for
e.g. SemVer), then use the current date to
populate default parts.

This enables updating YYYY patterns in copyright
headers even for projects that don't use a CalVer
pattern.
This commit is contained in:
Manuel Barkhau 2022-02-11 22:33:16 +00:00
parent 028d77751b
commit 53617b2624
4 changed files with 55 additions and 43 deletions

View file

@ -1200,7 +1200,7 @@ def test_multimatch_file_patterns(config_text, runner):
def _kwargs(year, month, minor=False):
return {'date': dt.date(year, month, 1), 'minor': minor}
return {'maybe_date': dt.date(year, month, 1), 'minor': minor}
ROLLOVER_TEST_CASES = [