copywrite icon indicating copy to clipboard operation
copywrite copied to clipboard

Update Copyright year

Open sgabenov opened this issue 2 years ago • 3 comments

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"

  1. So, when i run copywrite headers over file having already created header "HashiCorp, Inc. 2014-2022" will be changed into --> "HashiCorp, Inc. 2014-2023"
  2. .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 avatar Jul 11 '23 10:07 sgabenov

@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.

CalebAlbers avatar Jul 11 '23 18:07 CalebAlbers

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 avatar Aug 16 '23 16:08 iavael

@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 😄

CalebAlbers avatar Aug 16 '23 17:08 CalebAlbers