Conversation
…ed modules Compile all published Exposed modules with -Xreturn-value-checker=full (Kotlin 2.3+), which marks every declaration so downstream projects that enable the unused return value checker (check or full mode) also get ignored return values of Exposed's API reported. This is a metadata-only change and does not affect binary compatibility. Internally, intentional builder-style APIs whose results are ignored by design are annotated with @IgnorableReturnValue (QueryBuilder append family, Column.check, StringBuilder.appendIfNotNull), and remaining internal call sites that discard results on purpose now assign them to the discard-only 'val _ = ' form so the modules compile warning-free.
This branch has not been deployed
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.
Title
feat: EXPOSED-1089 Support return value checker
Body
Summary
Enables the Kotlin 2.3+ unused return value checker for Exposed, as requested in EXPOSED-1089.
-Xreturn-value-checker=full. This marks every declaration, so downstream projects that enable the checker (-Xreturn-value-checker=checkor=full) also get diagnostics for ignored return values of Exposed's API. The change is metadata-only and does not affect binary compatibility.@IgnorableReturnValue, both to keep Exposed's own build warning-free and to keep the checker quiet for these calls in downstream code (QueryBuilder.append/unaryPlus/appendTo,Column.check,StringBuilder.appendIfNotNull).val _ =form, so every module compiles with zero new warnings.The flag is applied centrally in the root
build.gradle.ktsto everyKotlinCompilationTaskof published modules; the four test-only modules are excluded, as they are not published.Verification
./gradlew compileKotlin: successful, zeroUnused return valuewarnings across all modules../gradlew apiCheck: passes; the binary-compatibility-validator output is unchanged, confirming binary compatibility../gradlew detekt: passes.exposed-core/exposed-jdbcwere published to Maven Local and a small consumer project compiled with-Xreturn-value-checker=check. An ignoredUsers.insert { ... }result is reported asUnused return value of 'insert', while a consumed result produces no warning — confirming the marking reaches dependent projects../gradlew test_h2_v2 :exposed-r2dbc-tests:test_h2_v2: successful — 3234 test cases across all modules, 0 failures, 0 errors (421 skipped by dialect-specific preconditions, as usual).Closes EXPOSED-1089