Skip to content

Commit 4db8d9d

Browse files
committed
fix latest dep tests
1 parent e0b0603 commit 4db8d9d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

conventions/src/main/kotlin/otel.errorprone-conventions.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies {
1010
}
1111

1212
val disableErrorProne = properties["disableErrorProne"]?.toString()?.toBoolean() ?: false
13+
val testLatestDeps = gradle.startParameter.projectProperties["testLatestDeps"] == "true"
1314

1415
tasks {
1516
withType<JavaCompile>().configureEach {
@@ -126,6 +127,13 @@ tasks {
126127
// We get this warning in modules that compile for old java versions
127128
disable("StringConcatToTextBlock")
128129

130+
if (testLatestDeps) {
131+
// Some latest dep tests are compiled for java 17 although the base version uses an older
132+
// version. Disable rules that suggest using new language features.
133+
disable("StatementSwitchToExpressionSwitch")
134+
disable("PatternMatchingInstanceof")
135+
}
136+
129137
if (name.contains("Jmh") || name.contains("Test")) {
130138
// Allow underscore in test-type method names
131139
disable("MemberName")

0 commit comments

Comments
 (0)