-
Notifications
You must be signed in to change notification settings - Fork 577
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
Improve LICENSE + copyright information & CONTRIBUTING file #2556
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65c76bd
to
57aa504
Compare
williballenthin
approved these changes
Jan 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @Ana06!
two things:
|
Replace LICENSE text file with the official Apache one: https://www.apache.org/licenses/LICENSE-2.0.txt This changes `Copyright (C) 2021 Mandiant, Inc.` by the following template language that had been incorrectly replaced: `Copyright [yyyy] [name of copyright owner]`
Improve CLA information to adhere to Google policies.
Use Google's default Code of Conduct for consistency with other Google's projects.
Replace the header from source code files using the following script: ```Python for dir_path, dir_names, file_names in os.walk("capa"): for file_name in file_names: # header are only in `.py` and `.toml` files if file_name[-3:] not in (".py", "oml"): continue file_path = f"{dir_path}/{file_name}" f = open(file_path, "rb+") content = f.read() m = re.search(OLD_HEADER, content) if not m: continue print(f"{file_path}: {m.group('year')}") content = content.replace(m.group(0), NEW_HEADER % m.group("year")) f.seek(0) f.write(content) ``` Some files had the copyright headers inside a `"""` comment and needed manual changes before applying the script. `hook-vivisect.py` and `pyinstaller.spec` didn't include the license in the header and also needed manual changes. The old header had the confusing sentence `All rights reserved`, which does not make sense for an open source license. Replace the header by the default Google header that corrects this issue and keep capa consistent with other Google projects. Adapt the linter to work with the new header. Replace also the copyright text in the `web/public/index.html` file for consistency.
Add copyright and license information headers to the source code files inside the `web` directory and the `capa/render/proto/capa.proto` file. I have used addlicense to add the headers.
This was referenced Jan 15, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace LICENSE text file with the official Apache one: https://www.apache.org/licenses/LICENSE-2.0.txt. This changes
Copyright (C) 2021 Mandiant, Inc.
by the following template language that had been incorrectly replaced:Copyright [yyyy] [name of copyright owner]
Improve CLA information to adhere to Google policies (one needed sentence was missing).
Use Google's default Code of Conduct for consistency with other Google's projects.
Replace the header from source code files. The old header had the confusing sentence
All rights reserved
, which does not make sense for an open source license. Replace the header by the default Google header that corrects this issue and keep capa consistent with other Google projects. Also replace also the copyright text in theweb/public/index.html
file for consistency and adapt the linter to work with the new header. The changes in the copyright header have been made with the following script:Some files had the copyright headers inside a
"""
comment and needed manual changes before applying the script.hook-vivisect.py
andpyinstaller.spec
didn't include the license in the header and also needed manual changes.Add missing headers to the source code files inside the
web
directory and thecapa/render/proto/capa.proto
file. I have used addlicense to add the headers. I think it would be a good idea to use addlicense as linter in this project, but I think we should wait until the following issues are resolved (and ensure there are no other issues): Ignore empty files google/addlicense#162, Support spec files google/addlicense#163. I can open an issue after this PR has been merged to propose using addlicense as linter.Related PRs in other Mandiant repositories: mandiant/flare-vm#638, mandiant/VM-Packages#1238
Checklist