Skip to content

Commit c22bb59

Browse files
fix(deps): update spotless packages to v7 (major) (#13004)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lauri Tulmin <[email protected]>
1 parent ae3f6ac commit c22bb59

File tree

41 files changed

+333
-425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+333
-425
lines changed

benchmark-overhead/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id("java")
3-
id("com.diffplug.spotless") version "6.25.0"
3+
id("com.diffplug.spotless") version "7.0.1"
44
}
55

66
spotless {

conventions/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
`kotlin-dsl`
33
// When updating, update below in dependencies too
4-
id("com.diffplug.spotless") version "6.25.0"
4+
id("com.diffplug.spotless") version "7.0.1"
55
}
66

77
spotless {
@@ -54,7 +54,7 @@ dependencies {
5454
implementation("org.apache.maven:maven-aether-provider:3.3.9")
5555

5656
// When updating, update above in plugins too
57-
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
57+
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.1")
5858
implementation("com.google.guava:guava:33.4.0-jre")
5959
implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.18")
6060
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.5")

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ spotless {
7676
// also very hard to find out where this happens
7777
"ktlint_standard_wrapping" to "disabled",
7878
// we use variable names like v1_10Deps
79-
"ktlint_standard_property-naming" to "disabled"
79+
"ktlint_standard_property-naming" to "disabled",
80+
// prevent moving comment to next line in latestDepTestLibrary("xxx") { // see xxx module
81+
"ktlint_standard_function-literal" to "disabled"
8082
)
8183
)
8284
}
@@ -97,7 +99,7 @@ if (project == rootProject) {
9799
"**/*.dockerfile",
98100
"**/gradle.properties"
99101
)
100-
indentWithSpaces()
102+
leadingTabsToSpaces()
101103
trimTrailingWhitespace()
102104
endWithNewline()
103105
}

examples/distro/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ buildscript {
1212
}
1313
}
1414
dependencies {
15-
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
15+
classpath "com.diffplug.spotless:spotless-plugin-gradle:7.0.1"
1616
classpath "com.gradleup.shadow:shadow-gradle-plugin:8.3.5"
1717
classpath "io.opentelemetry.instrumentation:gradle-plugins:2.12.0-alpha-SNAPSHOT"
1818
}

examples/extension/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
See https://imperceptiblethoughts.com/shadow/ for more details about Shadow plugin.
1212
*/
1313
id "com.gradleup.shadow" version "8.3.5"
14-
id "com.diffplug.spotless" version "6.25.0"
14+
id "com.diffplug.spotless" version "7.0.1"
1515

1616
id "io.opentelemetry.instrumentation.muzzle-generation" version "2.12.0-alpha-SNAPSHOT"
1717
id "io.opentelemetry.instrumentation.muzzle-check" version "2.12.0-alpha-SNAPSHOT"

instrumentation/finagle-http-23.11/javaagent/build.gradle.kts

+1-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ val scalaMinor = Regex("""^([0-9]+\.[0-9]+)\.?.*$""").find(scalaVersion)!!.run {
2525
minorVersion
2626
}
2727

28-
val scalified = fun(pack: String): String {
29-
return "${pack}_$scalaMinor"
30-
}
28+
val scalified = fun(pack: String): String = "${pack}_$scalaMinor"
3129

3230
dependencies {
3331
bootstrap(project(":instrumentation:executors:bootstrap"))

instrumentation/jmx-metrics/library/src/main/java/io/opentelemetry/instrumentation/jmx/engine/MetricRegistrar.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void enrollExtractor(
7171
String unit = metricInfo.getUnit();
7272

7373
switch (instrumentType) {
74-
// CHECKSTYLE:OFF
74+
// CHECKSTYLE:OFF
7575
case COUNTER:
7676
{
7777
// CHECKSTYLE:ON
@@ -88,7 +88,7 @@ void enrollExtractor(
8888
}
8989
break;
9090

91-
// CHECKSTYLE:OFF
91+
// CHECKSTYLE:OFF
9292
case UPDOWNCOUNTER:
9393
{
9494
// CHECKSTYLE:ON
@@ -105,7 +105,7 @@ void enrollExtractor(
105105
}
106106
break;
107107

108-
// CHECKSTYLE:OFF
108+
// CHECKSTYLE:OFF
109109
case GAUGE:
110110
{
111111
// CHECKSTYLE:ON
@@ -121,7 +121,7 @@ void enrollExtractor(
121121
logger.log(INFO, "Created Gauge for {0}", metricName);
122122
}
123123
break;
124-
// CHECKSTYLE:OFF
124+
// CHECKSTYLE:OFF
125125
case STATE:
126126
{
127127
// CHECKSTYLE:ON

instrumentation/kotlinx-coroutines/kotlinx-coroutines-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/instrumentationannotations/ExpandFramesClassVisitor.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -95,34 +95,34 @@ private static void copy(Object[] array, int count, List<Object> list) {
9595
@Override
9696
public void visitFrame(int type, int numLocal, Object[] local, int numStack, Object[] stack) {
9797
switch (type) {
98-
// An expanded frame.
98+
// An expanded frame.
9999
case Opcodes.F_NEW:
100-
// A compressed frame with complete frame data.
100+
// A compressed frame with complete frame data.
101101
case Opcodes.F_FULL:
102102
copy(local, numLocal, currentLocals);
103103
copy(stack, numStack, currentStack);
104104
break;
105-
// A compressed frame with exactly the same locals as the previous frame and with an empty
106-
// stack.
105+
// A compressed frame with exactly the same locals as the previous frame and with an empty
106+
// stack.
107107
case Opcodes.F_SAME:
108108
currentStack.clear();
109109
break;
110-
// A compressed frame with exactly the same locals as the previous frame and with a single
111-
// value on the stack.
110+
// A compressed frame with exactly the same locals as the previous frame and with a single
111+
// value on the stack.
112112
case Opcodes.F_SAME1:
113113
currentStack.clear();
114114
currentStack.add(stack[0]);
115115
break;
116-
// A compressed frame where locals are the same as the locals in the previous frame,
117-
// except that additional 1-3 locals are defined, and with an empty stack.
116+
// A compressed frame where locals are the same as the locals in the previous frame,
117+
// except that additional 1-3 locals are defined, and with an empty stack.
118118
case Opcodes.F_APPEND:
119119
currentStack.clear();
120120
for (int i = 0; i < numLocal; i++) {
121121
currentLocals.add(local[i]);
122122
}
123123
break;
124-
// A compressed frame where locals are the same as the locals in the previous frame,
125-
// except that the last 1-3 locals are absent and with an empty stack.
124+
// A compressed frame where locals are the same as the locals in the previous frame,
125+
// except that the last 1-3 locals are absent and with an empty stack.
126126
case Opcodes.F_CHOP:
127127
currentStack.clear();
128128
for (Iterator<Object> iterator =

instrumentation/kotlinx-coroutines/kotlinx-coroutines-1.0/javaagent/src/test/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/KotlinCoroutinesInstrumentationTest.kt

+2-6
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,7 @@ class KotlinCoroutinesInstrumentationTest {
461461
tracer.spanBuilder(opName).startSpan().end()
462462
}
463463

464-
private fun <T> runTest(dispatcherWrapper: DispatcherWrapper, block: suspend CoroutineScope.() -> T): T {
465-
return runTest(dispatcherWrapper.dispatcher, block)
466-
}
464+
private fun <T> runTest(dispatcherWrapper: DispatcherWrapper, block: suspend CoroutineScope.() -> T): T = runTest(dispatcherWrapper.dispatcher, block)
467465

468466
private fun <T> runTest(dispatcher: CoroutineDispatcher, block: suspend CoroutineScope.() -> T): T {
469467
val parentSpan = tracer.spanBuilder("parent").startSpan()
@@ -562,9 +560,7 @@ class KotlinCoroutinesInstrumentationTest {
562560
oldState.close()
563561
}
564562

565-
override fun updateThreadContext(context: CoroutineContext): Scope {
566-
return otelContext.makeCurrent()
567-
}
563+
override fun updateThreadContext(context: CoroutineContext): Scope = otelContext.makeCurrent()
568564
}
569565

570566
// regression test for

instrumentation/kotlinx-coroutines/kotlinx-coroutines-flow-1.3/javaagent-kotlin/src/main/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/flow/FlowUtil.kt

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter
1010
import kotlinx.coroutines.flow.Flow
1111
import kotlinx.coroutines.flow.onCompletion
1212

13-
fun <REQUEST, RESPONSE> onComplete(flow: Flow<*>, instrumenter: Instrumenter<REQUEST, RESPONSE>, context: Context, request: REQUEST & Any): Flow<*> {
14-
return flow.onCompletion { cause: Throwable? ->
15-
instrumenter.end(context, request, null, cause)
16-
}
13+
fun <REQUEST, RESPONSE> onComplete(flow: Flow<*>, instrumenter: Instrumenter<REQUEST, RESPONSE>, context: Context, request: REQUEST & Any): Flow<*> = flow.onCompletion { cause: Throwable? ->
14+
instrumenter.end(context, request, null, cause)
1715
}

instrumentation/kotlinx-coroutines/kotlinx-coroutines-flow-1.3/javaagent/src/test/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/KotlinCoroutines13InstrumentationTest.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,7 @@ class KotlinCoroutines13InstrumentationTest {
185185
tracer.spanBuilder(opName).startSpan().end()
186186
}
187187

188-
private fun <T> runTest(dispatcherWrapper: DispatcherWrapper, block: suspend CoroutineScope.() -> T): T {
189-
return runTest(dispatcherWrapper.dispatcher, block)
190-
}
188+
private fun <T> runTest(dispatcherWrapper: DispatcherWrapper, block: suspend CoroutineScope.() -> T): T = runTest(dispatcherWrapper.dispatcher, block)
191189

192190
private fun <T> runTest(dispatcher: CoroutineDispatcher, block: suspend CoroutineScope.() -> T): T {
193191
val parentSpan = tracer.spanBuilder("parent").startSpan()

instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/ApplicationRequestGetter.kt

+2-6
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import io.ktor.request.*
99
import io.opentelemetry.context.propagation.TextMapGetter
1010

1111
internal object ApplicationRequestGetter : TextMapGetter<ApplicationRequest> {
12-
override fun keys(carrier: ApplicationRequest): Iterable<String> {
13-
return carrier.headers.names()
14-
}
12+
override fun keys(carrier: ApplicationRequest): Iterable<String> = carrier.headers.names()
1513

16-
override fun get(carrier: ApplicationRequest?, name: String): String? {
17-
return carrier?.headers?.get(name)
18-
}
14+
override fun get(carrier: ApplicationRequest?, name: String): String? = carrier?.headers?.get(name)
1915
}

instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorHttpServerAttributesGetter.kt

+10-27
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,26 @@ import io.ktor.response.*
1111
import io.opentelemetry.instrumentation.api.semconv.http.HttpServerAttributesGetter
1212
import io.opentelemetry.instrumentation.ktor.isIpAddress
1313

14-
internal enum class KtorHttpServerAttributesGetter :
15-
HttpServerAttributesGetter<ApplicationRequest, ApplicationResponse> {
14+
internal enum class KtorHttpServerAttributesGetter : HttpServerAttributesGetter<ApplicationRequest, ApplicationResponse> {
1615
INSTANCE, ;
1716

18-
override fun getHttpRequestMethod(request: ApplicationRequest): String {
19-
return request.httpMethod.value
20-
}
17+
override fun getHttpRequestMethod(request: ApplicationRequest): String = request.httpMethod.value
2118

22-
override fun getHttpRequestHeader(request: ApplicationRequest, name: String): List<String> {
23-
return request.headers.getAll(name) ?: emptyList()
24-
}
19+
override fun getHttpRequestHeader(request: ApplicationRequest, name: String): List<String> = request.headers.getAll(name) ?: emptyList()
2520

26-
override fun getHttpResponseStatusCode(request: ApplicationRequest, response: ApplicationResponse, error: Throwable?): Int? {
27-
return response.status()?.value
28-
}
21+
override fun getHttpResponseStatusCode(request: ApplicationRequest, response: ApplicationResponse, error: Throwable?): Int? = response.status()?.value
2922

30-
override fun getHttpResponseHeader(request: ApplicationRequest, response: ApplicationResponse, name: String): List<String> {
31-
return response.headers.allValues().getAll(name) ?: emptyList()
32-
}
23+
override fun getHttpResponseHeader(request: ApplicationRequest, response: ApplicationResponse, name: String): List<String> = response.headers.allValues().getAll(name) ?: emptyList()
3324

34-
override fun getUrlScheme(request: ApplicationRequest): String {
35-
return request.origin.scheme
36-
}
25+
override fun getUrlScheme(request: ApplicationRequest): String = request.origin.scheme
3726

38-
override fun getUrlPath(request: ApplicationRequest): String {
39-
return request.path()
40-
}
27+
override fun getUrlPath(request: ApplicationRequest): String = request.path()
4128

42-
override fun getUrlQuery(request: ApplicationRequest): String {
43-
return request.queryString()
44-
}
29+
override fun getUrlQuery(request: ApplicationRequest): String = request.queryString()
4530

46-
override fun getNetworkProtocolName(request: ApplicationRequest, response: ApplicationResponse?): String? =
47-
if (request.httpVersion.startsWith("HTTP/")) "http" else null
31+
override fun getNetworkProtocolName(request: ApplicationRequest, response: ApplicationResponse?): String? = if (request.httpVersion.startsWith("HTTP/")) "http" else null
4832

49-
override fun getNetworkProtocolVersion(request: ApplicationRequest, response: ApplicationResponse?): String? =
50-
if (request.httpVersion.startsWith("HTTP/")) request.httpVersion.substring("HTTP/".length) else null
33+
override fun getNetworkProtocolVersion(request: ApplicationRequest, response: ApplicationResponse?): String? = if (request.httpVersion.startsWith("HTTP/")) request.httpVersion.substring("HTTP/".length) else null
5134

5235
override fun getNetworkPeerAddress(request: ApplicationRequest, response: ApplicationResponse?): String? {
5336
val remote = request.local.remoteHost

instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorServerTelemetry.kt

+6-4
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ class KtorServerTelemetry private constructor(
4848
extractor: (SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse>) -> SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse>
4949
) {
5050
builder.setStatusExtractor { prevExtractor ->
51-
SpanStatusExtractor { spanStatusBuilder: SpanStatusBuilder,
52-
request: ApplicationRequest,
53-
response: ApplicationResponse?,
54-
throwable: Throwable? ->
51+
SpanStatusExtractor {
52+
spanStatusBuilder: SpanStatusBuilder,
53+
request: ApplicationRequest,
54+
response: ApplicationResponse?,
55+
throwable: Throwable?
56+
->
5557
extractor(prevExtractor).extract(spanStatusBuilder, request, response, throwable)
5658
}
5759
}

instrumentation/ktor/ktor-1.0/library/src/main/kotlin/io/opentelemetry/instrumentation/ktor/v1_0/KtorServerTracing.kt

+6-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ class KtorServerTracing private constructor(
4949
extractor: (SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse>) -> SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse>
5050
) {
5151
builder.setStatusExtractor { prevExtractor ->
52-
SpanStatusExtractor { spanStatusBuilder: SpanStatusBuilder,
53-
request: ApplicationRequest,
54-
response: ApplicationResponse?,
55-
throwable: Throwable? ->
52+
SpanStatusExtractor {
53+
spanStatusBuilder: SpanStatusBuilder,
54+
request: ApplicationRequest,
55+
response: ApplicationResponse?,
56+
throwable: Throwable?
57+
->
5658
extractor(prevExtractor).extract(spanStatusBuilder, request, response, throwable)
5759
}
5860
}

0 commit comments

Comments
 (0)