Skip to content

fix: avoid duplicate newlines in appended resources - #862

Open
efegokdemir wants to merge 1 commit into
apache:masterfrom
efegokdemir:issue-798-appending-newlines
Open

efegokdemir wants to merge 1 commit into
apache:masterfrom
efegokdemir:issue-798-appending-newlines

Conversation

@efegokdemir

Copy link
Copy Markdown

Summary

Avoid adding a second line feed when an appended resource already ends with one.

Changes

  • Add a separator only when the processed resource does not already end with a line feed.
  • Add regression coverage for resources with and without a trailing line feed.

Testing

  • mvn -q -Dspotless.skip=true -Dcheckstyle.skip=true -Dtest=AppendingTransformerTest test — passed
  • mvn -q -Dspotless.skip=true -Dcheckstyle.skip=true verify — passed
  • git diff --check — passed

The local Spotless/Palantir formatter could not run because its installed formatter is incompatible with the local JDK; the repository's Java source formatting remains unchanged outside this focused diff.

Fixes #798

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
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.

AppendingTransformer generates undesired empty lines that cause errors

1 participant