Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,37 @@ tasks.withType(JavaCompile) {
}
```

or to `build.gradle.kts` if you use the [Kotlin Gradle DSL](https://docs.gradle.org/current/userguide/kotlin_dsl.html):
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

Remove trailing spaces and add blank line after code fence.

Markdown linting issues detected:

  • Line 51: 1 trailing space
  • Line 72: 8 trailing spaces
  • Line 79: Missing blank line after closing code fence

Apply this diff to fix formatting:

-or to `build.gradle.kts` if you use the [Kotlin Gradle DSL](https://docs.gradle.org/current/userguide/kotlin_dsl.html): 
+or to `build.gradle.kts` if you use the [Kotlin Gradle DSL](https://docs.gradle.org/current/userguide/kotlin_dsl.html):

For line 72, remove the 8 trailing spaces within the code block, and add a blank line after line 79:

         option("NullAway:AnnotatedPackages", "com.uber")
-        
+
         // Disable NullAway on test code
 }



Also applies to: 72-72, 79-79

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

51-51: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

In README.md around lines 51, 72 and 79: remove the single trailing space at
line 51, remove the 8 trailing spaces inside the code block at line 72, and add
one blank line immediately after the closing code fence at line 79 so there is
an empty line following the code block; save the file and re-run markdown
linting to confirm the trailing spaces are gone and the blank line after the
code fence is present.


</details>

<!-- This is an auto-generated comment by CodeRabbit -->


```kotlin
plugins {
// we assume you are already using the Java plugin
id("net.ltgt.errorprone") version "<plugin version>"
}
dependencies {
errorprone("com.uber.nullaway:nullaway:<NullAway version>")

// Some source of nullability annotations; JSpecify recommended,
// but others supported as well.
api("org.jspecify:jspecify:1.0.0")

errorprone("com.google.errorprone:error_prone_core:<Error Prone version>")
}

tasks.withType<JavaCompile>().configureEach {
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "com.uber")

// Disable NullAway on test code
if (name.lowercase().contains("test")) {
disable("NullAway")
}
}
}
```


Let's walk through this script step by step. The `plugins` section pulls in the [Gradle Error Prone plugin](https://github.com/tbroyer/gradle-errorprone-plugin) for Error Prone integration.

In `dependencies`, the first `errorprone` line loads NullAway, and the `api` line loads the [JSpecify](https://jspecify.dev) library which provides suitable nullability annotations, e.g., `org.jspecify.annotations.Nullable`. NullAway allows for any `@Nullable` annotation to be used, so, e.g., `@Nullable` from the AndroidX annotations Library or JetBrains annotations is also fine. The second `errorprone` line sets the version of Error Prone is used.
Expand Down