Closed glyn closed 5 years ago
I think I'm going to replace the single {{.Year}}
reserved parameter by two more granular ones: {{.StartYear}}
and {{.EndYear}}
. Then, users can choose to ignore either of them.
In this specific case, the template would become:
Copyright (c) {{.StartYear}}-Present Pivotal Software, Inc. All Rights Reserved.
This would be a nice improvement! I was about to see what I needed to do for getting a range in for years. A StartYear and EndYear parameter would be perfect.
Nice :) I will try to get that done this week, unless you want to give it a go @jmelfi?
@jmelfi note that the range of years, as of today, is completely managed by headache by extracting the earliest and latest commit years of each file.
If you've got a file first committed in 2005 and its last commit is in 2009, Copyright {{.Year}}
will yield Copyright 2005-2009
, unless the existing header start year is earlier than the first commit's year.
Was that your understanding as well? If not, I need to clarify the existing documentation to emphasize that automatic date ranges are already supported.
EDIT: the documentation is now clarified, Year
has been renamed to the more explicit YearRange
.
Some copyright lines are of the form YYYY-Present rather than YYYY-ZZZZ. For example: