Skip to content

Use the new CF plugin in the examples.#7474

Open
smillst wants to merge 2 commits intotypetools:masterfrom
smillst:new-cf-plugin
Open

Use the new CF plugin in the examples.#7474
smillst wants to merge 2 commits intotypetools:masterfrom
smillst:new-cf-plugin

Conversation

@smillst
Copy link
Member

@smillst smillst commented Feb 3, 2026

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

This PR updates Gradle build configuration in documentation examples. It bumps multiple plugins: the Error Prone plugin from 4.1.0 to 5.0.0, Lombok plugin from 8.10 to 9.2.0, and Checker Framework plugin from 0.6.49 to 1.0.0 across the example projects. The Error Prone core dependency is updated from 2.38.0 to 2.46.0. Explicit plugin applications and dependency declarations are replaced with simplified Checker Framework configuration blocks using local versioning. An empty settings.gradle file is added to the Lombok example directory.

Possibly related PRs

Suggested reviewers

  • mernst
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/examples/errorprone/build.gradle (1)

13-21: ⚠️ Potential issue | 🔴 Critical

Fix Error Prone version for Java 17/21 compatibility and correct the plugin declaration.

The else-branch cannot use error_prone_core:2.46.0 because it requires JDK 21+, not Java 17. The plugin version 5.0.0 does not exist in published repositories (latest is 4.3.0).

Either:

  1. Add a separate branch for Java 17 with a compatible Error Prone version (e.g., 2.31.0), and use 2.46.0 only for Java 21+, or
  2. Use a Java 17-compatible version for the else-branch (e.g., 2.31.0).

Additionally, correct the plugin declaration from version("5.0.0") to an actual published version (e.g., version("4.3.0")).

If using error_prone_core:2.46.0 on JDK 21, add -XDaddTypeAnnotationsToSymbol=true to the javac options.

🤖 Fix all issues with AI agents
In `@docs/examples/lombok/build.gradle`:
- Around line 11-13: Remove or update the stale commented block `lombok {
version = "1.18.30" }`: either delete that commented code since Lombok is now
configured in the `plugins {}` block, or replace it with a short clarifying
comment explaining how to override the Lombok version (e.g., indicate that
changing the version in `plugins { id "io.freefair.lombok" version "x.y.z" }` is
the correct approach). Ensure the file no longer contains the obsolete commented
`lombok` block so the example is not confusing.
- Around line 19-23: The checkerFramework block uses a nonstandard setting
version = "local" which only works when running the example from the repository
root using the repo's Gradle wrapper and included builds; update the example to
add an inline comment next to version = "local" (referencing the
checkerFramework configuration and the version = "local" line) that explains it
relies on the repo's included builds and must be run with the repo Gradle
wrapper, or alternatively expand the docs to show how to replace "local" with a
normal version string for running the example independently.

Comment on lines +11 to +13
//lombok {
// version = "1.18.30"
//}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Remove or update the stale commented Lombok block.

The commented lombok { version = "1.18.30" } looks obsolete now that the plugin version is set in plugins {}; consider removing it or clarifying how to override the Lombok version in this example.

♻️ Suggested cleanup
-//lombok {
-//  version = "1.18.30"
-//}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
//lombok {
// version = "1.18.30"
//}
🤖 Prompt for AI Agents
In `@docs/examples/lombok/build.gradle` around lines 11 - 13, Remove or update the
stale commented block `lombok { version = "1.18.30" }`: either delete that
commented code since Lombok is now configured in the `plugins {}` block, or
replace it with a short clarifying comment explaining how to override the Lombok
version (e.g., indicate that changing the version in `plugins { id
"io.freefair.lombok" version "x.y.z" }` is the correct approach). Ensure the
file no longer contains the obsolete commented `lombok` block so the example is
not confusing.

Comment on lines 19 to 23
checkerFramework {
version = "local"
checkers = [
"org.checkerframework.checker.nullness.NullnessChecker",
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's find the build.gradle file and read it
find . -path "*/examples/lombok/build.gradle" -type f

Repository: typetools/checker-framework

Length of output: 106


🏁 Script executed:

# Let's also check the directory structure around this file
ls -la docs/examples/lombok/ 2>/dev/null || find . -path "*/examples/lombok" -type d

Repository: typetools/checker-framework

Length of output: 414


🏁 Script executed:

# Search for any composite build or included build configuration
rg "includeBuild|composite" --type gradle --max-count 20

Repository: typetools/checker-framework

Length of output: 53


🏁 Script executed:

# Search for documentation about the checkerFramework version configuration
rg "version.*local" --type gradle -B 2 -A 2

Repository: typetools/checker-framework

Length of output: 665


🌐 Web query:

Checker Framework Gradle plugin version "local" configuration documentation

💡 Result:

The Checker Framework Gradle plugin (id("org.checkerframework")) does not document any version = "local" (or similar) extension setting. Instead, its documentation describes two “local” options:

  1. Use a locally published Checker Framework (via mavenLocal())
  • Publish CF to your local Maven repo, then add mavenLocal() and depend on the desired CF version via the checkerFramework(...) / compileOnly(...) coordinates. (github.com)
  1. Use a locally built (unpublished) Checker Framework build (-PcfLocal)
  • Run Gradle with -PcfLocal, set CHECKERFRAMEWORK to your CF checkout/build directory, and the plugin will use the JARs from that location (as shown in the README snippet). (github.com)

If what you meant by "local" is using a locally built copy of the plugin itself, the README documents publishing the plugin to mavenLocal() and adding mavenLocal() under pluginManagement { repositories { ... } } in settings.gradle. (github.com)

Citations:


🏁 Script executed:

# Read the build.gradle file with line numbers
cat -n docs/examples/lombok/build.gradle

Repository: typetools/checker-framework

Length of output: 743


🏁 Script executed:

# Read the settings.gradle file
cat -n docs/examples/lombok/settings.gradle

Repository: typetools/checker-framework

Length of output: 78


🏁 Script executed:

# Check for README or documentation files in the examples directory
ls -la docs/examples/lombok/

Repository: typetools/checker-framework

Length of output: 414


🏁 Script executed:

# Check the root settings.gradle for composite build setup
cat -n settings.gradle | head -50

Repository: typetools/checker-framework

Length of output: 596


🏁 Script executed:

# Look for any documentation about the examples or local version setup
find docs/examples -name "README*" -o -name "*.md" | head -10

Repository: typetools/checker-framework

Length of output: 249


🏁 Script executed:

# Read the Makefile to understand how this example is meant to be run
cat -n docs/examples/lombok/Makefile

Repository: typetools/checker-framework

Length of output: 1214


🏁 Script executed:

# Check if there's a README in the root docs/examples directory
ls -la docs/examples/

Repository: typetools/checker-framework

Length of output: 1122


🏁 Script executed:

# Search for any documentation about examples or "local" version in the repo
rg "local.*build|composite.*build" --type md --max-count 20

Repository: typetools/checker-framework

Length of output: 53


🏁 Script executed:

# Look for documentation in build files about version = "local"
rg "version.*=.*local" -B 5 -A 2 --type gradle

Repository: typetools/checker-framework

Length of output: 949


🏁 Script executed:

# Search for the checkerframework gradle plugin implementation in the repo
find . -name "*gradle*plugin*" -o -name "checkerframework*.gradle" | head -20

Repository: typetools/checker-framework

Length of output: 53


🏁 Script executed:

# Look for the plugin definition or version handling
rg "class.*CheckerFramework|extension\|version" --type kotlin --type java | grep -i checker | head -20

Repository: typetools/checker-framework

Length of output: 3503


🏁 Script executed:

# Check build folder or plugin source
find . -path "*/plugin*" -name "*.kt" -o -name "*.java" | grep -i checker | head -10

Repository: typetools/checker-framework

Length of output: 1074


🌐 Web query:

checkerframework-gradle-plugin "version = local" implementation

💡 Result:

checkerframework-gradle-plugin does not support version = "local" as a special value. To use a locally built plugin you have two standard Gradle options:

Option A (recommended): composite build (no version in plugins {})

  1. Clone/build the plugin locally.
  2. In your consumer project’s settings.gradle(.kts):
pluginManagement {
  includeBuild("../checkerframework-gradle-plugin")
  repositories {
    gradlePluginPortal()
  }
}
  1. In your consumer project’s build.gradle(.kts):
plugins {
  id("org.checkerframework")
}

Gradle resolves the plugin from the included build, so you must not specify a version here. [2], [3]

Option B: publish to mavenLocal() (use a real version string)

  1. In the plugin repo:
./gradlew publishToMavenLocal
  1. In the consumer project’s settings.gradle(.kts):
pluginManagement {
  repositories {
    mavenLocal()
    gradlePluginPortal()
  }
}
  1. Apply with an actual published version (whatever the plugin build published), e.g.:
plugins {
  id("org.checkerframework") version "0.6.61"
}

(0.6.61 is the current portal version; your local publish may be a different version.) [1], [2]

If you meant implementation(...) (for convention plugins / build-logic)

Use the plugin marker artifact (again, with a real version):

dependencies {
  implementation("org.checkerframework:org.checkerframework.gradle.plugin:0.6.61")
}

[1]


🏁 Script executed:

# Search for checkerframework plugin source or implementation that handles version property
rg "version" docs/examples/lombok/build.gradle -B 2 -A 2

Repository: typetools/checker-framework

Length of output: 391


🏁 Script executed:

# Look for documentation or comments in build files about how version "local" works
rg "local|version" docs/ --type gradle -B 3 -A 1 | grep -A 5 -B 5 "local"

Repository: typetools/checker-framework

Length of output: 828


🏁 Script executed:

# Check if there's a gradle plugin build in the repo
find . -path "*gradle*plugin*" -name "build.gradle*" 2>/dev/null | head -5

Repository: typetools/checker-framework

Length of output: 53


🌐 Web query:

checkerframework-gradle-plugin extension configuration version property documentation

💡 Result:

The org.checkerframework Gradle plugin (kelloggm/checkerframework-gradle-plugin) does not document an extension property like checkerFramework { version = "…" } / checkerFrameworkVersion for selecting the Checker Framework version. Instead, you set the Checker Framework version by declaring explicit dependencies (which override the plugin’s default CF version). [1]

Example (Gradle Kotlin DSL equivalent in Groovy is analogous):

dependencies {
  compileOnly("org.checkerframework:checker-qual:3.4.0")
  testCompileOnly("org.checkerframework:checker-qual:3.4.0")
  checkerFramework("org.checkerframework:checker:3.4.0")
}

This is the approach shown in the plugin’s README under “Specifying a Checker Framework version”. [1]

(Separately, the plugin’s own version is set in the plugins {} block, e.g. id("org.checkerframework") version "0.6.61". [2])

Sources: [1] [2]


Add documentation explaining version = "local" in the Checker Framework configuration.

The checkerFramework { version = "local" } setting relies on the Checker Framework's included builds in the root project and only works when the example is executed from within the repository using the repo's Gradle wrapper. This configuration is not standard in the Checker Framework Gradle plugin documentation and will confuse users attempting to run the example independently.

Add an inline comment (e.g., // Uses the Checker Framework built in the repo's included builds) or update documentation to clarify this requirement.

🤖 Prompt for AI Agents
In `@docs/examples/lombok/build.gradle` around lines 19 - 23, The checkerFramework
block uses a nonstandard setting version = "local" which only works when running
the example from the repository root using the repo's Gradle wrapper and
included builds; update the example to add an inline comment next to version =
"local" (referencing the checkerFramework configuration and the version =
"local" line) that explains it relies on the repo's included builds and must be
run with the repo Gradle wrapper, or alternatively expand the docs to show how
to replace "local" with a normal version string for running the example
independently.

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.

1 participant