Open iMckify opened 5 months ago
Thanks for reporting in such detail! From the examples you've given it should be possible to create a unit test in EmptyNewlineAtEndOfFileTest, using Assertions.groovy
, similar to this one.
https://github.com/openrewrite/rewrite/blob/133e56af0fdd3e1c96d4e98b5ae8e8503c6c2507/rewrite-java-test/src/test/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFileTest.java#L67-L77
Then from there we can hopefully add a fix to the recipe implementation as seen here https://github.com/openrewrite/rewrite/blob/133e56af0fdd3e1c96d4e98b5ae8e8503c6c2507/rewrite-java/src/main/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFile.java#L62-L81
Or if that fails, add an exception to the recipe to not run on Groovy files (not ideal).
I am using
How are you running OpenRewrite?
I am using the Gradle plugin, and my project is a single module project.
What is the smallest, simplest way to reproduce the problem?
Create POGO class with final fields and constructor only, key thing is that last two closing brackets should be separated by empty line like
full file here:
What did you expect to see?
Last closing bracket '}' should exist
What did you see instead?
Last '}' missing
What is the full stack trace of any errors you encountered?