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

chore: ensure all text files end with a single blank newline #567

Merged
merged 4 commits into from
Mar 19, 2025

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Mar 14, 2025

While we have this captured with .editorconfig which is supported by a lot of editors, it's very easy to miss in the review UI and in VSCode in particular requires an extension to be installed meaning people need to be aware it's a thing; so this setups up CI to explicitly check and warn about this.

Unsurprisingly this has revealed a handful of files that have extraneous end-of-file newlines, most of which are in test files though I don't think they're actually critical to the test so I have removed them - the only ones I've ignored are two that are explicitly covering behaviour when there are trailing newlines, though I actually suspect it would be fine to have just a single newline at the end of the file, which would be nice at it would let us avoid needing a .linelint config, but for now I've just ignored them.

Relates to #455

@G-Rath G-Rath force-pushed the ci/enforce-end-of-file-newline branch 4 times, most recently from 98444eb to 7cf0568 Compare March 14, 2025 22:27
@G-Rath G-Rath changed the title ci: ensure that all text files end with a newline chore: ensure all text files end with a single blank newline Mar 14, 2025
@G-Rath G-Rath force-pushed the ci/enforce-end-of-file-newline branch from 7cf0568 to 0b9683d Compare March 17, 2025 03:40
@G-Rath G-Rath force-pushed the ci/enforce-end-of-file-newline branch from 0b9683d to acc483e Compare March 18, 2025 18:54
@G-Rath G-Rath requested a review from another-rex March 18, 2025 18:54
@G-Rath G-Rath marked this pull request as ready for review March 18, 2025 18:54
@G-Rath G-Rath requested review from cuixq and erikvarga March 18, 2025 18:54
Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Hmm we might want to add this to a blocking check in internal PRs as well, but let's just have it in github for now and see how it goes.

@copybara-service copybara-service bot merged commit e694041 into google:main Mar 19, 2025
11 checks passed
@G-Rath G-Rath deleted the ci/enforce-end-of-file-newline branch March 19, 2025 00:08
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