Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check copyright year #12

Open
bmarwell opened this issue Apr 11, 2021 · 9 comments
Open

Check copyright year #12

bmarwell opened this issue Apr 11, 2021 · 9 comments

Comments

@bmarwell
Copy link

Hi,

is there support for copyright year check?
Some projects use start,lastmod. E.g.
Copyright 2011,2021 …

Others modify the date only on updating the file, so some files might have Copyright 2021 … while others have older years.

And a mix of both, obviously.

@kt3k
Copy link
Owner

kt3k commented Apr 11, 2021

Currently there is no support of mixed years in copyright headers.

Is mixing years in copyright header common or good thing? Personally I often see people updating all years in headers around the new years day.

@bmarwell
Copy link
Author

Personally I often see people updating all years in headers around the new years day.

Yikes. I am a java developer and contribute to apache projects. As far as I can tell, there is usually one year only, which is updated when the file is being modified. I do not think updating projects at new year is a good thing. It is not a functional change, and if forgotten will fail PRs and future builds.

@bmarwell
Copy link
Author

Also mentioned in the GPL FAQ: https://www.gnu.org/licenses/gpl-howto.html

@kt3k
Copy link
Owner

kt3k commented Apr 12, 2021

If mixture of different years is allowed, do you have any idea of the design of the config file?

@bmarwell
Copy link
Author

I basically would allow regex to be included. Sadly this would not be downwards compatible.

@ni4
Copy link

ni4 commented Oct 21, 2021

Got to this repository via search, to automate latest year inclusion. I.e. just to check whether pushed files contains current year in copyright string. It could be done as dealing with copyright as regexp, adding some placeholders like ${YEAR}, ${FILENAME}, maybe something else could be useful as well.

@mars-risc0
Copy link

mars-risc0 commented Jan 17, 2023

Is mixing years in copyright header common or good thing?

I don't think I have ever seen a codebase older than one year which did not include mixed years in copyright headers. It is common to see a range, for example "Copyright (c) 2003-2009 Foo, Inc.".

Personally I often see people updating all years in headers around the new years day.

Several of the places I have worked would have absolutely forbidden such a large, non-functional change across the entire codebase.

@kt3k
Copy link
Owner

kt3k commented Jan 18, 2023

I'm now thinking about the config structure like the below for allowing multiple year patterns.

{
  "**/*.js": "// Copyright {YEAR} My Name. All rights reserved. MIT license.",
  "params": {
    "YEAR": "some regexp?"
  }
}

@ladislas
Copy link

@kt3k this would be amazing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants