Skip to content

Commit

Permalink
disable PreferSafeLogger and StrictUnusedVariable for intellij (#2878)
Browse files Browse the repository at this point in the history
  • Loading branch information
FinlayRJW authored Sep 18, 2024
1 parent 7d80667 commit 32a3d42
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-2878.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: disable PreferSafeLogger and StrictUnusedVariable for intellij
links:
- https://github.com/palantir/gradle-baseline/pull/2878
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ private static void applyToJavaProject(Project project) {
errorProneOptions.disable("Slf4jLogsafeArgs");
}));
});

project.getPluginManager().withPlugin("org.jetbrains.intellij", appliedPlugin -> {
project.getTasks().withType(JavaCompile.class).configureEach(javaCompile -> ((ExtensionAware)
javaCompile.getOptions())
.getExtensions()
.configure(ErrorProneOptions.class, errorProneOptions -> {
errorProneOptions.disable("PreferSafeLogger");
errorProneOptions.disable("PreferSafeLoggableExceptions");
errorProneOptions.disable("PreferSafeLoggingPreconditions");
errorProneOptions.disable("StrictUnusedVariable");
}));
});
}

@SuppressWarnings("UnstableApiUsage")
Expand Down

0 comments on commit 32a3d42

Please sign in to comment.