capa icon indicating copy to clipboard operation
capa copied to clipboard

update copyright to 2024

Open williballenthin opened this issue 1 year ago • 9 comments

update here: https://github.com/mandiant/capa/blob/9e5cc07a48fada9042e106c0b21504c80d58af21/.github/flake8.ini#L41

then fix the linter violations, and/or use a recursive sed

williballenthin avatar Jan 11 '24 12:01 williballenthin

Hi there, I want to contribute to this.

Harsh1s avatar Jan 11 '24 16:01 Harsh1s

At the bottom of the LICENSE.txt file on line 190, it still says Copyright (C) 2023 Mandiant, Inc. Should I update this?

JCoonradt avatar Jan 26 '24 22:01 JCoonradt

every copyright instance of 2023 should be replaced with 2024 across all files

williballenthin avatar Jan 27 '24 07:01 williballenthin

I think we don't need to do this, see https://nexb.com/do-you-really-need-to-update-the-copyright-each-new-year/:

Popular open source projects like Google’s Go, Microsoft’s VS Code, and Netflix’s Hystrix already just list the first year of the copyright. Others dropped years altogether – Facebook removed years from React, and so did GitHub, Facebook and Amazon.

mr-tz avatar Jan 29 '24 09:01 mr-tz

let's also check with Google's open source office to see what they recommend. i don't feel strongly in any direction.

williballenthin avatar Jan 29 '24 18:01 williballenthin

Google policy is to list the year that the file was introduced. We should not be updating the date from year to year.

We can use git history to figure out when each file was first added. It won't fully recover when files are moved around, but it's better than what we do today.

It's unfortunate that the header can't be consistent throughout and therefore easy to lint and check. Oh well.

I'm sympathetic to the positions taken by the other big projects, though I think we should follow the guidance of our org here. Thoughts?

williballenthin avatar Jan 29 '24 21:01 williballenthin

I think using that policy makes sense. The initial update will be slightly more work, but then moving forward it should be easy.

mr-tz avatar Jan 30 '24 13:01 mr-tz

Ok, I can work on this! So, I will go through the history, find the year of each file's original introduction, and then set that as the year in the file.

JCoonradt avatar Jan 31 '24 17:01 JCoonradt

Sounds perfect.

Of course, I'd discourage you from doing this manually. Perhaps a one-off Bash or Python script can do it more quickly.

williballenthin avatar Jan 31 '24 19:01 williballenthin

it seems most of the files already have the copyright of the file for the year that were introduced in or am i maybe missing something here ?

Atlas-64 avatar Feb 29 '24 09:02 Atlas-64

Yes, probably. The regex and some files probably need updating though.

mr-tz avatar Feb 29 '24 10:02 mr-tz

If @JCoonradt isn't working actively on this issue anymore, is it okay if I give it a try? @williballenthin @mr-tz

Atlas-64 avatar Mar 04 '24 19:03 Atlas-64

Yes, I think you can go ahead.

mr-tz avatar Mar 05 '24 08:03 mr-tz

Sorry for the delay; looking at the code right now, and if I understand right, any instance of copyright across any file type should be changed with its file origin year; asking cuz currently writing a recursive sed so I thought I should clear my doubt if I should just run it through all python executables (and also look for any regex statements) only or should I run it all across the repo looking for any instance of copyright and do the above action @mr-tz

Atlas-64 avatar Mar 11 '24 07:03 Atlas-64

@Atlas-64 yes, it should be across all source files. Please review the resulting diff and use your judgement to ensure only the relevant changes are made. The purpose here is to set only the copyright headers so that people that read the code understand the copyright and origins.

williballenthin avatar Mar 11 '24 08:03 williballenthin

Okay, cool. I am done running the script; I just had a question about the license. Do I update it to 2024 or keep it as 2020(its origin) and the same doubt for the regex (just change it to 2024?) . It works perfectly fine for everything else. I ended up just writing a powershell script and running through the whole repo, used gits commit history to get the origin, and changed it accordingly through a recursive, so we are good on that part. I just had a doubt about the above 2 will make a PR after changing them .Thanks for any help :) @williballenthin

Atlas-64 avatar Mar 11 '24 15:03 Atlas-64

We want to list the year that the file was introduced.

mr-tz avatar Mar 11 '24 15:03 mr-tz

closed via #2027

mr-tz avatar Mar 13 '24 16:03 mr-tz