Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ with(extensions["spotlessPredeclare"] as SpotlessExtension) {
java {
removeUnusedImports()

googleJavaFormat("1.35.0")
tableTestFormatter("1.1.1")
googleJavaFormat(libs.versions.google.java.format.get())
tableTestFormatter(libs.versions.tabletest.formatter.get())
}
groovyGradle {
greclipse()
Expand All @@ -49,14 +49,13 @@ with(extensions["spotlessPredeclare"] as SpotlessExtension) {
greclipse()
}
kotlinGradle {
ktlint("1.8.0")
ktlint(libs.versions.ktlint.get())
}
kotlin {
ktlint("1.8.0")
ktlint(libs.versions.ktlint.get())
}
scala {
// TODO: For some reason Scala format is working correctly with this version only.
scalafmt("3.8.6")
scalafmt(libs.versions.scalafmt.get())
}
}
apply(from = rootDir.resolve("gradle/spotless.gradle"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spotless {
target("src/**/*.java")
// ignore embedded test projects
targetExclude("src/test/resources/**")
googleJavaFormat("1.35.0")
googleJavaFormat(libs.versions.google.java.format.get())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HomeController @Inject() (cc: ControllerComponents) extends AbstractContro
implicit request: Request[AnyContent] =>
error match {
case Some(x) => throw new RuntimeException("some sync error")
case None => {
case None => {
var workTime = workTimeMS.getOrElse(0L)
scheduleWork(workTime)
Ok("Did " + workTime + "ms of work.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import scala.concurrent.duration._

class AkkaActors extends AutoCloseable {
val system: ActorSystem = ActorSystem("akka-actors-test")
val receiver: ActorRef =
val receiver: ActorRef =
system.actorOf(Receiver.props, "receiver")
val forwarder: ActorRef =
system.actorOf(Forwarder.props(receiver), "forwarder")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ object AkkaHttpTestWebServer {
resp.withEntity(uri.queryString().orNull)
case REDIRECT =>
resp.withHeaders(headers.Location(endpoint.getBody))
case ERROR => resp.withEntity(endpoint.getBody)
case EXCEPTION => throw new Exception(endpoint.getBody)
case ERROR => resp.withEntity(endpoint.getBody)
case EXCEPTION => throw new Exception(endpoint.getBody)
case USER_BLOCK => {
Blocking.forUser("user-to-block").blockIfMatch()
// should never be output:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ object AkkaHttpTestWebServer {
resp.withEntity(uri.queryString().orNull)
case REDIRECT =>
resp.withHeaders(headers.Location(endpoint.getBody))
case ERROR => resp.withEntity(endpoint.getBody)
case EXCEPTION => throw new Exception(endpoint.getBody)
case ERROR => resp.withEntity(endpoint.getBody)
case EXCEPTION => throw new Exception(endpoint.getBody)
case USER_BLOCK => {
Blocking.forUser("user-to-block").blockIfMatch()
// should never be output:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import scala.concurrent.duration._

class PekkoActors extends AutoCloseable {
val system: ActorSystem = ActorSystem("pekko-actors-test")
val receiver: ActorRef =
val receiver: ActorRef =
system.actorOf(Receiver.props, "receiver")
val forwarder: ActorRef =
system.actorOf(Forwarder.props(receiver), "forwarder")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ object PekkoHttpTestWebServer {
resp.withHeaders(headers.Location(endpoint.getBody))
case ERROR => resp.withEntity(endpoint.getBody)
case EXCEPTION => throw new Exception(endpoint.getBody)
case _ =>
case _ =>
if (path.startsWith("/injected-id/")) {
val groups = path.split('/')
if (groups.size == 4) { // The path starts with a / and has 3 segments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object WeaverIntegrationTestRunner {
val framework = new CatsEffect(new PrintStream(System.out))
val runner = framework.runner(Array.empty, Array.empty, getClass.getClassLoader)
val scalaTestNames: List[String] = testNames.asScala.toList
val taskDefs: Array[TaskDef] = scalaTestNames.map { name =>
val taskDefs: Array[TaskDef] = scalaTestNames.map { name =>
new TaskDef(name, SuiteFingerprint, false, Array(new SuiteSelector()))
}.toArray
val tasks = runner.tasks(taskDefs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object ZioTestFixtures {
run {
for {
childStarted <- Promise.make[Nothing, Unit]
_ <- childSpan("fiber_1_span_1") {
_ <- childSpan("fiber_1_span_1") {
for {
child <- childSpan("fiber_2_span_1") {
childStarted.succeed(()) *>
Expand Down Expand Up @@ -117,7 +117,7 @@ object ZioTestFixtures {
private def childSpan(opName: String)(op: UIO[Unit]): UIO[Unit] =
ZIO.scoped {
for {
scope <- ZIO.scope
scope <- ZIO.scope
ddSpan <- ZIO.succeed(
AgentTracer
.get()
Expand All @@ -137,7 +137,7 @@ object ZioTestFixtures {
private def run[A](zio: ZIO[Any, Nothing, A]): Unit = {
val executor = Executors.newSingleThreadExecutor()
val zioExecutor = Executor.fromJavaExecutor(executor)
val layer =
val layer =
Runtime.setExecutor(zioExecutor) >>>
Runtime.setBlockingExecutor(zioExecutor)
try {
Expand Down
2 changes: 1 addition & 1 deletion dd-smoke-tests/play-2.4/app/filters/AbstractFilter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class AbstractFilter(val operationName: String, val wrap: Boolean) exte
)(requestHeader: RequestHeader): Future[Result] = {
val tracer = GlobalTracer.get
val startedSpan = if (wrap) tracer.buildSpan(operationName).start else null
val outerScope =
val outerScope =
if (wrap) tracer.scopeManager.activate(startedSpan) else null
try {
nextFilter(requestHeader).map { result =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void setup() {
"space is encoded | [serverNode: 'DF 28'] | 'serverNode=DF%2028' ",
"non ASCII value | [userId: Amélie] | 'userId=Am%C3%A9lie' ",
"parenthesis in key | ['user!d(me)': false] | 'user!d%28me%29=false' ",
"non ASCII heart symbol | [abcdefg: 'hijklmnopq♥'] | 'abcdefg=hijklmnopq%E2%99%A5' "
"non ASCII heart symbol | [abcdefg: 'hijklmnopq♥'] | 'abcdefg=hijklmnopq%E2%99%A5' "
})
void testBaggagePropagatorContextInjection(Map<String, String> baggageMap, String baggageHeader) {
this.context = Baggage.create(baggageMap).storeInto(this.context);
Expand Down Expand Up @@ -93,7 +93,7 @@ void testBaggageInjectItemLimit(Map<String, String> baggage, String baggageHeade
"scenario | baggage | baggageHeader ",
"limit not reached | [key1: val1, key2: val2] | 'key1=val1,key2=val2'",
"third entry exceeds bytes | [key1: val1, key2: val2, key3: val3] | 'key1=val1,key2=val2'",
"single entry exceeds bytes once encoded | [abcdefg: 'hijklmnopq♥'] | '' "
"single entry exceeds bytes once encoded | [abcdefg: 'hijklmnopq♥'] | '' "
})
void testBaggageInjectBytesLimit(Map<String, String> baggage, String baggageHeader) {
// Creating propagator with test bytes limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SpanPointersProcessorTest extends DDJavaSpecification {
@TableTest({
"scenario | objectKey | eTag | expectedHash ",
"basic values | some-key.data | ab12ef34 | e721375466d4116ab551213fdea08413",
"non-ascii key | some-key.你好 | ab12ef34 | d1333a04b9928ab462b5c6cadfa401f4 ",
"non-ascii key | some-key.你好 | ab12ef34 | d1333a04b9928ab462b5c6cadfa401f4",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL we have chinese in the repo

"multipart etag | some-key.data | ab12ef34-5 | 2b90dffc37ebc7bc610152c3dc72af9f"
})
void spanPointersProcessorAddsCorrectLink(String objectKey, String eTag, String expectedHash) {
Expand Down
3 changes: 2 additions & 1 deletion gradle/enforcement/spotless-scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version = 3.8.6
# Keep aligned with the scalafmt version in ../libs.versions.toml.
version = 3.11.5
runner.dialect = scala213
align.preset = more
maxColumn = 100
6 changes: 6 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ jsr305 = "3.0.2"
shadow = "9.4.2"
spotbugs_annotations = "4.10.2"

# Source code formatters
google-java-format = "1.36.1"
ktlint = "1.8.0"
scalafmt = "3.11.5"
tabletest-formatter = "1.1.2"

# DataDog libs and forks
ddprof = "1.48.1"
dogstatsd = "4.4.5"
Expand Down
11 changes: 5 additions & 6 deletions gradle/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ spotless {
target 'src/**/*.java'
// ignore embedded test projects and everything in build dir, e.g. generated sources
targetExclude('src/test/resources/**', buildDirectoryFiles)
tableTestFormatter('1.1.1')
googleJavaFormat('1.35.0')
tableTestFormatter(libs.versions.tabletest.formatter.get())
googleJavaFormat(libs.versions.google.java.format.get())
}
}

Expand All @@ -45,7 +45,7 @@ spotless {
toggleOffOn()
// same as kotlin, but for .gradle.kts files (defaults to '*.gradle.kts')
target '*.gradle.kts'
ktlint('1.8.0').editorConfigOverride([
ktlint(libs.versions.ktlint.get()).editorConfigOverride([
// Disable trailing comma rules to minimize diff.
'ktlint_standard_trailing-comma-on-call-site': 'disabled',
'ktlint_standard_trailing-comma-on-declaration-site': 'disabled'
Expand All @@ -69,8 +69,7 @@ spotless {
scala {
toggleOffOn()
targetExclude(buildDirectoryFiles)
// TODO: For some reason Scala format is working correctly with this version only.
scalafmt('3.8.6').configFile(configPath + '/enforcement/spotless-scalafmt.conf')
scalafmt(libs.versions.scalafmt.get()).configFile(configPath + '/enforcement/spotless-scalafmt.conf')
}
}

Expand All @@ -93,7 +92,7 @@ spotless {
kotlin {
toggleOffOn()
targetExclude(buildDirectoryFiles)
ktlint('1.8.0').editorConfigOverride([
ktlint(libs.versions.ktlint.get()).editorConfigOverride([
// Disable trailing comma rules to minimize diff.
'ktlint_standard_trailing-comma-on-call-site': 'disabled',
'ktlint_standard_trailing-comma-on-declaration-site': 'disabled'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import org.openjdk.jmh.infra.Blackhole;

/**
*
*
* <ul>
* Benchmark to illustrate the trade-offs around case-insensitive Map look-ups - using either...
* <li>(RECOMMENDED) TreeMap with Comparator of String::compareToIgnoreCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import org.openjdk.jmh.annotations.Warmup;

/**
*
*
* <ul>
* Benchmark comparing HashingUtils.hash to Objects.hash
* <li>(RECOMMENDED) HashingUtils.hash - avoids var-arg creation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import org.openjdk.jmh.annotations.Warmup;

/**
*
*
* <ul>
* Benchmark comparing different approaches to filling and reading a Map in a multi-thread
* context.
Expand Down
4 changes: 2 additions & 2 deletions test-published-dependencies/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ allprojects {
spotless {
kotlinGradle {
target("*.gradle.kts")
ktlint("1.8.0").editorConfigOverride(
ktlint(libs.versions.ktlint.get()).editorConfigOverride(
mapOf(
// Disable trailing comma rules to minimize diff.
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
Expand All @@ -31,7 +31,7 @@ allprojects {
}
java {
target("src/**/*.java")
googleJavaFormat("1.35.0")
googleJavaFormat(libs.versions.google.java.format.get())
}
}
}
8 changes: 8 additions & 0 deletions test-published-dependencies/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
rootProject.name = "test-published-dependencies"

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}

include(":all-deps-exist")
include(":ot-pulls-in-api")
include(":ot-is-shaded")
Expand Down