Update Copyright year
I want to manage not only copyright header, but also years in it.
For example, my header should look like: copyright_holder = "HashiCorp, Inc. 2014-2023"
- So, when i run
copywrite headersover file having already created header "HashiCorp, Inc. 2014-2022" will be changed into --> "HashiCorp, Inc. 2014-2023" - .copywrite.hcl config file should support variables, so i can template headers like
copyright_holder = "HashiCorp, Inc. ${var.copyright_year}-2023"
copyright_year = 2014
@sgabenov thanks for taking the time to outline this! Currently, we use a forked and modified version of addLicense to manage the copyright header additions. Copywrite's current functionality is append-only; it doesn't support identifying and replacing existing copyright headers.
That said, I'd welcome the functionality. It likely isn't something that will be prioritized on the internal roadmap, but if that's something you'd be interested in contributing to, we can chat about implementation options.
I like the template string idea for the copyright statement - I could see having a base set of available templating options, such as copyright_year, current_year, copyright_holder(s), spdx_license_id, etc.
Isn't copyright year should reflect years when copyrighted work was changed? In that case, if a work is licensed on a per-file basis, then the copyright dates of a particular file should contain only years when changes took place.
@iavael The copyright claim itself is based on the year of initial publication*, so we made the conscious decision to not include the current year or any years a modification took place in the claim. The upside is that it leaves a cleaner file history and doesn't require changing the copyright statement annually.
*Obligatory "I'm not a lawyer" disclaimer 😄