lint: add trailing whitespace and missing newline checks#4582
Draft
lint: add trailing whitespace and missing newline checks#4582
Conversation
Remove trailing whitespace from all source files and ensure all text files end with a newline. Add lint checks to prevent reintroduction of both issues. Fixes #4581 Signed-off-by: Jan Dubois <jan.dubois@suse.com>
1e04681 to
ca322b2
Compare
Member
Author
|
While fixing one of the test failures I realized that YAML files actually can have semantically significant trailing white space in text blocks. I think Markdown can have it too. Personally I consider those to be mis-features, as the trailing whitespace is often not visible in the shell, so I would prefer that we don't use these features. But I wanted to point this out, in case somebody disagrees. |
AkihiroSuda
reviewed
Feb 14, 2026
| @@ -576,6 +576,16 @@ bats: native limactl-plugins | |||
|
|
|||
| .PHONY: lint | |||
| lint: check-generated | |||
AkihiroSuda
reviewed
Feb 14, 2026
| @result=$$(git grep -rIl '' -- . ':!*.pb.desc' | while IFS= read -r f; do \ | ||
| test "$$(tail -c 1 "$$f")" && echo "$$f: missing newline at end of file"; \ | ||
| done); \ | ||
| if [ -n "$$result" ]; then echo "$$result"; echo "Please ensure all text files end with a newline"; false; fi |
Member
There was a problem hiding this comment.
Maybe we can rather use https://github.com/editorconfig-checker/editorconfig-checker or something else existing
Member
|
Next time please use your fork |
Member
Author
Sorry, that was an accident; I normally do. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove trailing whitespace from all source files and ensure all text files end with a newline. Add lint checks to prevent reintroduction of both issues.
Fixes #4581