-
Notifications
You must be signed in to change notification settings - Fork 77
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
Conversation
d417b79
to
17bae13
Compare
83f153c
to
9d9bdc0
Compare
9d9bdc0
to
deb096d
Compare
anchor_line_number = -2 | ||
for i, line in enumerate(lines[:EXAMINED_LINES]): | ||
text = line[:50].lower() | ||
if "copyright" in text: |
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.
Why do we need this branch, could we merge it with the next one?
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.
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.
scripts/update_copyright_headers.py
Outdated
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): |
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.
Could it be "copyright" in text
instead of anchor_line_number == -1
and removing the above line?
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.
Agree, this logic could be written better (I abused integer line counter by using it as a status variable). Will push an update.
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.
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.
Is that possible to fix the tests, maybe in a follow up PR? |
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. |
23e8461
to
aa2ddb2
Compare
aa2ddb2
to
e04a812
Compare
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.
offline discussion, lgtm !
This PR comprises a script to auto-update copyright headers
scripts/update_copyright_headers.py
, its output, and a few other manual changes.