rubicon-oss / LicenseHeaderManager

Manage license headers for your source code files in Visual Studio
178 stars 40 forks source link

Replace same year range with single year #60

Open schiffm opened 7 years ago

schiffm commented 7 years ago

Our copyright includes a year range from the file creation year to the current year. For example:

// Copyright © 2012-2017 Acme. All rights reserved.

To accomplish this, our licenseheader file uses this:

// Copyright © %CreationYear%-%CureentYear% Acme. All rights reserved.

For new files, we would like not to repeat the year, e.g., "© 2017 Acme" instead of "© 2017-2017 Acme". Is there a way to suppress the creation year (and the hyphen) if it equals the current year? Maybe a mechanism for conditionally adding or eliminating some of the header text, or some other way to handle year ranges? Thanks in advance.

MichaelKetting commented 7 years ago

Interesting feature proposal. At the moment, I don't have an idea for a good design, though. basically, there's just the option of building special logic for this scenario (i.e. a created/modified year property with a fixed hyphen) or a full-fledged expression sytanx to allow for custom properties. The downside with the specific property is that it's very rigid (e.g. never spaces or always spaces) and for full-fledges expressions, it's certainly the question of how often it's needed and of course, the effort required to build such a feature.

I'm open for a discussion of ideas for what's a sensible design :)

Best regards, Michael