license-header-checker icon indicating copy to clipboard operation
license-header-checker copied to clipboard

Copyright year

Open huntantr opened this issue 3 years ago • 3 comments

When using this tool to check for a copyright, is there anyway to make the year be less specific. We have source code that hasn't changed in years, so it won't have a 2022 year in it, but a 2020.

Thanks.

huntantr avatar Sep 29 '22 14:09 huntantr

Hello @huntantr,

Can you please describe the concrete use case you want to achieve so I can better help you?

lluissm avatar Sep 30 '22 17:09 lluissm

I assume he wants unchanged files to retain the original copyright year.

example.h with copyright 2020, should remain 2020 until example.h is changed.

If example.h is changed in 2022, then it should change to copyright 2020, 2022

hatvik avatar Oct 05 '22 13:10 hatvik

If the -r flag is not supplied, the tool will not replace the copyright header if there is already one. You could just use -a to only add to the ones that do not have any.

But then, if you need to update the year in the copyright header after modifying the file, you should do it manually when you update the file as the tool does not really know when you modified the file.

lluissm avatar Oct 07 '22 21:10 lluissm