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

copyright: do not add extra blank line #2502

Merged
merged 1 commit into from
Aug 13, 2019

Conversation

garyverhaegen-da
Copy link
Contributor

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.

@@ -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]))
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation!

@garyverhaegen-da garyverhaegen-da force-pushed the copyright-remove-added-blank-line branch from ce672ea to dedd277 Compare August 13, 2019 10:05
Copy link
Contributor

@cocreature cocreature left a 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]))
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation!

@cocreature cocreature merged commit 7363d73 into master Aug 13, 2019
@garyverhaegen-da garyverhaegen-da deleted the copyright-remove-added-blank-line branch August 13, 2019 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants