Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rely on gradle-baseline provided error-prone #1567

Merged
merged 1 commit into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ buildscript {
dependencies {
classpath 'com.palantir.gradle.jdks:gradle-jdks:0.27.0'
classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.4.0'
classpath 'com.google.errorprone:error_prone_core:2.14.0'
classpath 'com.palantir.baseline:gradle-baseline-java:4.161.0'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.11.0'
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.11.0'
Expand Down Expand Up @@ -68,6 +67,7 @@ allprojects {
options.errorprone {
option('NullAway:AnnotatedPackages', 'com.palantir')
option('NullAway:CheckOptionalEmptiness', 'true')
option('AllSuggestionsAsWarnings') // https://github.com/google/error-prone/pull/3301
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nifty!

Copy link

Choose a reason for hiding this comment

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

Hello, the author of the linked Error Prone ticket here!

I just wanted to point out that we maintain our own fork of Error Prone where we already support this feature.
It's a fork that contains a minimal set of changes on top of mainline Error Prone. We've been using it internally for years.
Just to give you an idea; see the extra commits we have on top of the original v2.15.0 tag here PicnicSupermarket/error-prone@v2.15.0...v2.15.0-picnic-3.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This feature isn't yet released, but this should pick it up once we get the bump through gradle-baseline


// warnings not explicitly provided by error-prone
error 'NullAway',
Expand All @@ -78,10 +78,6 @@ allprojects {
'PreferSafeLoggableExceptions',
'PreferSafeLogger'

// increase strictness for built-in error-prone checks
error((com.google.errorprone.scanner.BuiltInCheckerSuppliers.ENABLED_WARNINGS +
com.google.errorprone.scanner.BuiltInCheckerSuppliers.DISABLED_CHECKS
).collect { it.canonicalName() } as String[])
Comment on lines -81 to -84
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These imports were the main reason for needing com.google.errorprone:error_prone_core on gradle classpath. Going to switch over to not-yet-merged or released AllSuggestionsAsWarnings from google/error-prone#3301 to opt-in to more strict checks


disable 'AndroidJdkLibsChecker', // ignore Android
'Java7ApiChecker', // tritium requires JDK 11+
Expand Down
2 changes: 1 addition & 1 deletion versions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
com.github.ben-manes.caffeine:caffeine:3.1.1 (1 constraints: 0705fe35)
com.google.auto.service:auto-service-annotations:1.0.1 (1 constraints: 0405f135)
com.google.code.findbugs:jsr305:3.0.2 (4 constraints: 5c3586ed)
com.google.errorprone:error_prone_annotations:2.14.0 (9 constraints: 1376d655)
com.google.errorprone:error_prone_annotations:2.14.0 (8 constraints: dc70754c)
com.google.guava:failureaccess:1.0.1 (1 constraints: 140ae1b4)
com.google.guava:guava:31.1-jre (5 constraints: 6b423e36)
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (1 constraints: bd17c918)
Expand Down
1 change: 0 additions & 1 deletion versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ com.github.ben-manes.caffeine:caffeine = 3.1.1
com.google.auto:* = 1.2.1
com.google.auto.service:* = 1.0.1
com.google.code.findbugs:jsr305 = 3.0.2
com.google.errorprone:* = 2.12.1
com.google.guava:guava = 31.1-jre
com.google.testing.compile:compile-testing = 0.19
com.palantir.goethe:* = 0.8.0
Expand Down