-
Notifications
You must be signed in to change notification settings - Fork 205
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
copyright: do not add extra blank line #2502
Conversation
@@ -209,7 +209,7 @@ def process_file(filename, check_only): | |||
# copyright header existed, but was out of date, replace it. | |||
fp.write("".join(before_header)) | |||
fp.write(header) | |||
fp.write("".join(after_header)) | |||
fp.write("".join(after_header[:-1])) |
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.
What happens if there is no trailing newline in the file? Will we discard the last line in this case?
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.
Thanks for the explanation!
ce672ea
to
dedd277
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.
Thanks!
@@ -209,7 +209,7 @@ def process_file(filename, check_only): | |||
# copyright header existed, but was out of date, replace it. | |||
fp.write("".join(before_header)) | |||
fp.write(header) | |||
fp.write("".join(after_header)) | |||
fp.write("".join(after_header[:-1])) |
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.
Thanks for the explanation!
The current copyright script adds an extra blank line at the end of every single file it modifies. This confuses our various code linters, including getting to cases where running
./fmt.sh
after the copyright update is not enough to make things work again (apparently typescript doesn't like files ending with more than one blank line).This is a tiny fix that results in the copyright script strictly changing the lines it should change. It is not done as part of #2499 because we squash, but it is very much part of the same update.