sbt-header icon indicating copy to clipboard operation
sbt-header copied to clipboard

Add a simple `headerEndYear` key for configuring year ranges in license headers

Open vasilmkd opened this issue 3 years ago • 1 comments

We're big fans of sbt-header in sbt-typelevel and would like to upstream this change that we use in our projects. It is a simple scheme for specifying an optional headerEndYear. The range resolution is done in a very simplistic way, but it goes very far in our projects.

Namely, headerEndYear is None by default, but if provided and is greater than the startYear, a range of the following format is constructed:

startYear := Some(2021)
headerEndYear := Some(2022)

results in 2021-2022 as the year range, which is then inserted into the license header as the year. In any other case, the headerEndYear is simply ignored.

Opening this PR to jumpstart a discussion. I'm of course open to making this scheme more general and I'm looking forward to proposed improvements.

Thanks in advance.

vasilmkd avatar Feb 20 '22 12:02 vasilmkd

A lot of the code is added in such a way that preserves both source and binary compatibility of builds.

vasilmkd avatar Feb 20 '22 12:02 vasilmkd

Nice contribution! Thanks!

hseeberger avatar Oct 20 '22 07:10 hseeberger