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

Update copyright headers across the codebase #1075

Merged
merged 3 commits into from
Oct 18, 2023
Merged

Conversation

meta-paul
Copy link
Contributor

@meta-paul meta-paul commented Oct 12, 2023

This PR comprises a script to auto-update copyright headers scripts/update_copyright_headers.py, its output, and a few other manual changes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 12, 2023
@meta-paul meta-paul force-pushed the add-copyright-headers branch 6 times, most recently from d417b79 to 17bae13 Compare October 12, 2023 19:26
@meta-paul meta-paul force-pushed the add-copyright-headers branch 4 times, most recently from 83f153c to 9d9bdc0 Compare October 12, 2023 20:13
anchor_line_number = -2
for i, line in enumerate(lines[:EXAMINED_LINES]):
text = line[:50].lower()
if "copyright" in text:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this branch, could we merge it with the next one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating copyright is a different task from creating review app, or other tasks within release v1.2, so I've decided to create a separate branch. In addition, it has a large diff, and resolving potential conflicts is easier from a separate branch.

text = line[:50].lower()
if "copyright" in text:
anchor_line_number = -1
if anchor_line_number == -1 and ("meta" in text or "facebook" in text):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be "copyright" in text instead of anchor_line_number == -1 and removing the above line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, this logic could be written better (I abused integer line counter by using it as a status variable). Will push an update.

Copy link
Contributor

@mojtaba-komeili mojtaba-komeili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script makes sense and the outcome is what we expected. LGTM.

Feel free to ignore my other comments. It made more sense after seeing the rest of the code.

@mojtaba-komeili
Copy link
Contributor

Is that possible to fix the tests, maybe in a follow up PR?

@meta-paul
Copy link
Contributor Author

Unittests are broken here (not because copyright script broke the code, but rather it's been a long-standing issue). They will be fixed in a separate branch, and it's not an easy task.

@meta-paul meta-paul force-pushed the add-copyright-headers branch from 23e8461 to aa2ddb2 Compare October 17, 2023 23:48
@meta-paul meta-paul force-pushed the add-copyright-headers branch from aa2ddb2 to e04a812 Compare October 17, 2023 23:49
Copy link
Contributor

@meganung meganung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

offline discussion, lgtm !

@meta-paul meta-paul merged commit 913ce6a into v1.2-dev Oct 18, 2023
4 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants