Skip to content

Commit c426f8c

Browse files
Bump spotless to latest version 8.1.0 (#9881)
1 parent 53f913f commit c426f8c

File tree

348 files changed

+2315
-1279
lines changed

Some content is hidden

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

348 files changed

+2315
-1279
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,12 @@ spotless:
364364
extends: .gradle_build
365365
stage: tests
366366
needs: []
367+
variables:
368+
# TODO: Latest version of spotless is failing with OOM on CI only.
369+
# Setting 8G memory solving this issue, but we need to solve it eventually.
370+
GRADLE_MEM: 8G
371+
KUBERNETES_MEMORY_REQUEST: 18Gi
372+
KUBERNETES_MEMORY_LIMIT: 18Gi
367373
script:
368374
- ./gradlew --version
369375
- ./gradlew spotlessCheck $GRADLE_ARGS

build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
id("dd-trace-java.config-inversion-linter")
1010
id("dd-trace-java.ci-jobs")
1111

12-
id("com.diffplug.spotless") version "6.13.0"
12+
id("com.diffplug.spotless") version "8.1.0"
1313
id("com.github.spotbugs") version "6.4.7"
1414
id("de.thetaphi.forbiddenapis") version "3.10"
1515
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
@@ -36,7 +36,7 @@ with(extensions["spotlessPredeclare"] as SpotlessExtension) {
3636
removeUnusedImports()
3737

3838
// This is the last Google Java Format version that supports Java 8
39-
googleJavaFormat("1.7")
39+
googleJavaFormat("1.32.0")
4040
}
4141
groovyGradle {
4242
greclipse()
@@ -45,13 +45,14 @@ with(extensions["spotlessPredeclare"] as SpotlessExtension) {
4545
greclipse()
4646
}
4747
kotlinGradle {
48-
ktlint("0.41.0")
48+
ktlint("1.8.0")
4949
}
5050
kotlin {
51-
ktlint("0.41.0")
51+
ktlint("1.8.0")
5252
}
5353
scala {
54-
scalafmt("2.7.5")
54+
// TODO: For some reason Scala format is working correctly with this version only.
55+
scalafmt("3.8.6")
5556
}
5657
}
5758
apply(from = rootDir.resolve("gradle/spotless.gradle"))
@@ -145,7 +146,8 @@ testAggregate("instrumentation", listOf(":dd-java-agent:instrumentation"), empty
145146
testAggregate("profiling", listOf(":dd-java-agent:agent-profiling"), emptyList())
146147
testAggregate("debugger", listOf(":dd-java-agent:agent-debugger"), forceCoverage = true)
147148
testAggregate(
148-
"base", listOf(":"),
149+
"base",
150+
listOf(":"),
149151
listOf(
150152
":dd-java-agent:instrumentation",
151153
":dd-smoke-tests",

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
`java-gradle-plugin`
44
`kotlin-dsl`
55
`jvm-test-suite`
6-
id("com.diffplug.spotless") version "6.13.0"
6+
id("com.diffplug.spotless") version "8.1.0"
77
}
88

99
java {

buildSrc/call-site-instrumentation-plugin/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
java
33
groovy
4-
id("com.diffplug.spotless") version "6.13.0"
4+
id("com.diffplug.spotless") version "8.1.0"
55
id("com.gradleup.shadow") version "8.3.6"
66
}
77

@@ -17,8 +17,7 @@ spotless {
1717
target("src/**/*.java")
1818
// ignore embedded test projects
1919
targetExclude("src/test/resources/**")
20-
// This is the last Google Java Format version that supports Java 8
21-
googleJavaFormat("1.7")
20+
googleJavaFormat("1.32.0")
2221
}
2322
}
2423

components/context/src/main/java/datadog/context/ContextKey.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
*/
1111
public final class ContextKey<T> {
1212
private static final AtomicInteger NEXT_INDEX = new AtomicInteger(0);
13+
1314
/** The key name, for debugging purpose only. */
1415
private final String name;
16+
1517
/** The key unique context, related to {@link IndexedContext} implementation. */
1618
final int index;
1719

components/context/src/main/java/datadog/context/propagation/Concern.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
public class Concern {
99
/** The concern default priority. */
1010
public static final int DEFAULT_PRIORITY = 100;
11+
1112
/** The concern name, for debugging purpose only. */
1213
private final String name;
14+
1315
/** The concern priority, lower value means higher priority. */
1416
private final int priority;
1517

dd-java-agent/agent-bootstrap/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,4 @@ tasks.withType(Test).configureEach {
7373
JavaVersion.VERSION_16,
7474
['--add-opens', 'java.base/java.net=ALL-UNNAMED'] // for HostNameResolverForkedTest
7575
)
76-
7776
}

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,9 @@ private static boolean isDebugMode() {
15001500
return false;
15011501
}
15021502

1503-
/** @return {@code true} if the agent feature is enabled */
1503+
/**
1504+
* @return {@code true} if the agent feature is enabled
1505+
*/
15041506
private static boolean isFeatureEnabled(AgentFeature feature) {
15051507
// must be kept in sync with logic from Config!
15061508
final String featureConfigKey = feature.getConfigKey();
@@ -1530,7 +1532,9 @@ private static boolean isFeatureEnabled(AgentFeature feature) {
15301532
}
15311533
}
15321534

1533-
/** @see datadog.trace.api.ProductActivation#fromString(String) */
1535+
/**
1536+
* @see datadog.trace.api.ProductActivation#fromString(String)
1537+
*/
15341538
private static boolean isFullyDisabled(final AgentFeature feature) {
15351539
// must be kept in sync with logic from Config!
15361540
final String featureConfigKey = feature.getConfigKey();
@@ -1568,7 +1572,9 @@ private static String getNullIfEmpty(final String value) {
15681572
return value;
15691573
}
15701574

1571-
/** @return configured JMX start delay in seconds */
1575+
/**
1576+
* @return configured JMX start delay in seconds
1577+
*/
15721578
private static int getJmxStartDelay() {
15731579
String startDelay = ddGetProperty("dd.dogstatsd.start-delay");
15741580
if (startDelay == null) {

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InitializationTelemetry.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ static final class BootstrapProxy extends InitializationTelemetry {
9797
// DQH - Decided not to eager access MethodHandles, since exceptions are uncommon
9898
// However, MethodHandles are cached on lookup
9999

100-
/** @param bootstrapInitTelemetry - non-null BootstrapInitializationTelemetry */
100+
/**
101+
* @param bootstrapInitTelemetry - non-null BootstrapInitializationTelemetry
102+
*/
101103
BootstrapProxy(final Object bootstrapInitTelemetry) {
102104
this.bootstrapInitTelemetry = bootstrapInitTelemetry;
103105
}

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstanceStore.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public final class InstanceStore<T> {
1919
private static final ClassValue<InstanceStore> classInstanceStore =
2020
GenericClassValue.of(type -> new InstanceStore<>());
2121

22-
/** @return global store of instances with the same common type */
22+
/**
23+
* @return global store of instances with the same common type
24+
*/
2325
@SuppressWarnings("unchecked")
2426
public static <T> InstanceStore<T> of(Class<T> type) {
2527
return classInstanceStore.get(type);

0 commit comments

Comments
 (0)