-
Notifications
You must be signed in to change notification settings - Fork 201
/
ai.errorprone-conventions.gradle.kts
71 lines (54 loc) · 1.94 KB
/
ai.errorprone-conventions.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import net.ltgt.gradle.errorprone.errorprone
plugins {
id("net.ltgt.errorprone")
}
dependencies {
errorprone("com.google.errorprone:error_prone_core")
}
val disableErrorProne = properties["disableErrorProne"]?.toString()?.toBoolean() ?: false
tasks {
withType<JavaCompile>().configureEach {
with(options) {
errorprone {
if (disableErrorProne) {
logger.warn("Errorprone has been disabled. Build may not result in a valid PR build.")
isEnabled.set(false)
}
disableWarningsInGeneratedCode.set(true)
allDisabledChecksAsWarnings.set(true)
excludedPaths.set(".*/build/generated/.*")
if (System.getenv("CI") == null) {
disable("SystemOut")
}
// Still Java 8
disable("Varifier")
// Intellij does a nice job of displaying parameter names
disable("BooleanParameter")
// Needed for legacy 2.x bridge
disable("JavaUtilDate")
// Doesn't work well with Java 8
disable("FutureReturnValueIgnored")
// Require Guava
disable("AutoValueImmutableFields")
disable("StringSplitter")
disable("ImmutableMemberCollection")
// Don't currently use this (to indicate a local variable that's mutated) but could
// consider for future.
disable("Var")
// Don't support Android without desugar
disable("AndroidJdkLibsChecker")
disable("Java7ApiChecker")
disable("StaticOrDefaultInterfaceMethod")
// needed temporarily while hosting azure-monitor-opentelemetry-exporter in this repo
disable("MissingSummary")
disable("UnnecessaryDefaultInEnumSwitch")
disable("InconsistentOverloads")
// consider enabling this after removing azure-monitor-exporter from this repo
disable("CanIgnoreReturnValueSuggester")
if (name.contains("Jmh")) {
disable("MemberName")
}
}
}
}
}