Skip to content

Add lombok.checkReturnValueAnnotation to Lombok best practices - #1214

Merged
timtebeek merged 1 commit into
mainfrom
tim/lombok-check-return-value-config
Aug 21, 2026
Merged

Add lombok.checkReturnValueAnnotation to Lombok best practices#1214
timtebeek merged 1 commit into
mainfrom
tim/lombok-check-return-value-config

Conversation

@timtebeek

@timtebeek timtebeek commented Aug 21, 2026

Copy link
Copy Markdown
Member
  • Lombok 1.18.47 adds the lombok.checkReturnValueAnnotation config key, which makes Lombok generate @lombok.CheckReturnValue on methods whose return value should not be ignored, such as @With methods and @Builder's build(); a future Lombok release may enable it by default.

LombokBestPractices now appends lombok.checkReturnValueAnnotation += lombok to any existing lombok.config via AppendToTextFile with existingFileStrategy: Merge, which makes it idempotent. The glob {,**/}lombok.config is used rather than **/lombok.config because Java's PathMatcher does not match a repository-root lombok.config against the latter; as a consequence no lombok.config is created for projects that lack one.

Note that 1.18.47 is not on Maven Central yet (latest is 1.18.46), so until it ships Lombok will print an unknown-config-key warning to stderr; UpdateLombokToJava11 floats on 1.18.* and will pick it up automatically.

Lombok 1.18.47 adds the `lombok.checkReturnValueAnnotation` config key,
which makes Lombok generate `@lombok.CheckReturnValue` on methods whose
return value should not be ignored, such as `@With` methods and
`@Builder`'s `build()`.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Aug 21, 2026
@timtebeek
timtebeek merged commit 4b948cb into main Aug 21, 2026
1 check passed
@timtebeek
timtebeek deleted the tim/lombok-check-return-value-config branch August 21, 2026 09:01
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant