Skip to content
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: 6 additions & 0 deletions changelog/@unreleased/pr-1094.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: fix
fix:
description: The `PreferJavaTimeOverload` error-prone check is turned off as it
produces noisy false positives relating to custom AssertJ utilities.
links:
- https://github.com/palantir/gradle-baseline/pull/1094
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public class BaselineErrorProneExtension {
// Built-in checks
"ArrayEquals",
"MissingOverride",
"UnnecessaryParentheses");
"UnnecessaryParentheses",
"PreferJavaTimeOverload");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I think the checkExplicitlyDisabled function will actually prevent these auto-fixes being applied until we get rid of the explicit CheckSeverity.OFF setting... I'm kinda OK with just leaving this here so that when we re-enable the check it will start patching.


private final ListProperty<String> patchChecks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ private static void configureErrorProneOptions(
errorProneOptions.setExcludedPaths(String.format(
"%s%s(build|src%sgenerated.*)%s.*", Pattern.quote(projectPath), separator, separator, separator));
errorProneOptions.check("UnusedVariable", CheckSeverity.OFF);
errorProneOptions.check("PreferJavaTimeOverload", CheckSeverity.OFF); // https://github.com/google/error-prone/issues/1435, https://github.com/google/error-prone/issues/1437
errorProneOptions.check("EqualsHashCode", CheckSeverity.ERROR);
errorProneOptions.check("EqualsIncompatibleType", CheckSeverity.ERROR);
errorProneOptions.check("StreamResourceLeak", CheckSeverity.ERROR);
Expand All @@ -200,13 +201,13 @@ private static void configureErrorProneOptions(
errorProneOptions.check("URLEqualsHashCode", CheckSeverity.ERROR);

if (jdkVersion.compareTo(JavaVersion.toVersion("12.0.1")) >= 0) {
// Errorprone isn't officially compatible with Java12, but in practise everything
// As of version 2.3.4, Errorprone isn't officially compatible with Java12, but in practise everything
// works apart from this one check: https://github.com/google/error-prone/issues/1106
errorProneOptions.check("Finally", CheckSeverity.OFF);
}

if (jdkVersion.compareTo(JavaVersion.toVersion("13.0.0")) >= 0) {
// Errorprone isn't officially compatible with Java13 either
// Errorprone 2.3.4 isn't officially compatible with Java13 either
// https://github.com/google/error-prone/issues/1106
errorProneOptions.check("TypeParameterUnusedInFormals", CheckSeverity.OFF);
errorProneOptions.check("PreferCollectionConstructors", CheckSeverity.OFF);
Expand Down