Skip to content

Commit f4898d9

Browse files
authored
Merge pull request #1348 from Philippus/apply-scalafmtsbt
Set up scalafmtSbt
2 parents b8dea69 + 1b46829 commit f4898d9

File tree

12 files changed

+336
-352
lines changed

12 files changed

+336
-352
lines changed

.git-blame-ignore-revs

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Initial scalafmtAll was applied
22
022216d6b1ebe4dd0c00aef204625f7f3372fc90
3+
# Initial scalafmtSbt was applied
4+
75eea26c78cd437116617eedc9bc1a144d163921

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,4 @@ jobs:
2727
jvm: adopt:8
2828
apps: sbt
2929
- name: Test
30-
run: sbt -v "+scalafmtCheckAll"
31-
30+
run: sbt -v "+scalafmtCheckAll;scalafmtSbtCheck"

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ If you want to make a code contribution to the project
2626

2727
Awesome! First, please note that we try to follow the [commit message conventions] used by the Spray guys and we need
2828
you to electronically fill our [CLA] before accepting your contribution. This project uses scalafmt for style, so
29-
remember to apply scalafmtAll to your commit. Also, if your PR contains various commits, please squash them into a
30-
single commit. Let the PR rain begin!
29+
remember to apply scalafmtAll and scalafmtSbt to your commit. Also, if your PR contains various commits, please squash
30+
them into a single commit. Let the PR rain begin!
3131

3232

3333
[open an issue]: https://github.com/kamon-io/Kamon/issues/new

build.sbt

+140-189
Large diffs are not rendered by default.

instrumentation/kamon-akka/build.sbt

+64-59
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ lazy val `Compile-Akka-2.6` = config("akka-2.6")
1515
/**
1616
* Test Configurations
1717
*/
18-
lazy val TestCommon = config("test-common") extend(Common)
19-
lazy val `Test-Akka-2.5` = config("test-akka-2.5") extend(`Compile-Akka-2.5`)
20-
lazy val `Test-Akka-2.6` = config("test-akka-2.6") extend(`Compile-Akka-2.6`)
18+
lazy val TestCommon = config("test-common") extend (Common)
19+
lazy val `Test-Akka-2.5` = config("test-akka-2.5") extend (`Compile-Akka-2.5`)
20+
lazy val `Test-Akka-2.6` = config("test-akka-2.6") extend (`Compile-Akka-2.6`)
2121

2222
configs(
2323
Common,
@@ -34,91 +34,98 @@ inConfig(Common)(Defaults.compileSettings ++ Seq(
3434
crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version)
3535
))
3636

37-
libraryDependencies ++= { if(scalaBinaryVersion.value == "2.11") Seq.empty else Seq(
38-
kanelaAgent % Common,
39-
scalatest % TestCommon,
40-
logbackClassic % TestCommon,
41-
"com.typesafe.akka" %% "akka-actor" % `Akka-2.6-version` % Common,
42-
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % Common,
43-
"com.typesafe.akka" %% "akka-slf4j" % `Akka-2.6-version` % Common,
44-
"com.typesafe.akka" %% "akka-remote" % `Akka-2.6-version` % Common,
45-
"com.typesafe.akka" %% "akka-cluster" % `Akka-2.6-version` % Common,
46-
"com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.6-version` % Common,
47-
"com.typesafe.akka" %% "akka-protobuf" % `Akka-2.6-version` % Common,
48-
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % TestCommon
49-
)}
50-
37+
libraryDependencies ++= {
38+
if (scalaBinaryVersion.value == "2.11") Seq.empty
39+
else Seq(
40+
kanelaAgent % Common,
41+
scalatest % TestCommon,
42+
logbackClassic % TestCommon,
43+
"com.typesafe.akka" %% "akka-actor" % `Akka-2.6-version` % Common,
44+
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % Common,
45+
"com.typesafe.akka" %% "akka-slf4j" % `Akka-2.6-version` % Common,
46+
"com.typesafe.akka" %% "akka-remote" % `Akka-2.6-version` % Common,
47+
"com.typesafe.akka" %% "akka-cluster" % `Akka-2.6-version` % Common,
48+
"com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.6-version` % Common,
49+
"com.typesafe.akka" %% "akka-protobuf" % `Akka-2.6-version` % Common,
50+
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % TestCommon
51+
)
52+
}
5153

5254
inConfig(`Compile-Akka-2.6`)(Defaults.compileSettings ++ Seq(
5355
crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version),
5456
sources := joinSources(Common, `Compile-Akka-2.6`).value
5557
))
5658

57-
libraryDependencies ++= { if(scalaBinaryVersion.value == "2.11") Seq.empty else Seq(
58-
kanelaAgent % `Compile-Akka-2.6`,
59-
scalatest % `Test-Akka-2.6`,
60-
logbackClassic % `Test-Akka-2.6`,
61-
"com.typesafe.akka" %% "akka-actor" % `Akka-2.6-version` % `Compile-Akka-2.6`,
62-
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % `Compile-Akka-2.6`,
63-
"com.typesafe.akka" %% "akka-slf4j" % `Akka-2.6-version` % `Compile-Akka-2.6`,
64-
"com.typesafe.akka" %% "akka-remote" % `Akka-2.6-version` % `Compile-Akka-2.6`,
65-
"com.typesafe.akka" %% "akka-cluster" % `Akka-2.6-version` % `Compile-Akka-2.6`,
66-
"com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.6-version` % `Compile-Akka-2.6`,
67-
"com.typesafe.akka" %% "akka-protobuf" % `Akka-2.6-version` % `Compile-Akka-2.6`,
68-
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % `Test-Akka-2.6`
69-
)}
70-
59+
libraryDependencies ++= {
60+
if (scalaBinaryVersion.value == "2.11") Seq.empty
61+
else Seq(
62+
kanelaAgent % `Compile-Akka-2.6`,
63+
scalatest % `Test-Akka-2.6`,
64+
logbackClassic % `Test-Akka-2.6`,
65+
"com.typesafe.akka" %% "akka-actor" % `Akka-2.6-version` % `Compile-Akka-2.6`,
66+
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % `Compile-Akka-2.6`,
67+
"com.typesafe.akka" %% "akka-slf4j" % `Akka-2.6-version` % `Compile-Akka-2.6`,
68+
"com.typesafe.akka" %% "akka-remote" % `Akka-2.6-version` % `Compile-Akka-2.6`,
69+
"com.typesafe.akka" %% "akka-cluster" % `Akka-2.6-version` % `Compile-Akka-2.6`,
70+
"com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.6-version` % `Compile-Akka-2.6`,
71+
"com.typesafe.akka" %% "akka-protobuf" % `Akka-2.6-version` % `Compile-Akka-2.6`,
72+
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.6-version` % `Test-Akka-2.6`
73+
)
74+
}
7175

7276
inConfig(`Compile-Akka-2.5`)(Defaults.compileSettings ++ Seq(
7377
sources := joinSources(Common, `Compile-Akka-2.5`).value
7478
))
7579

76-
libraryDependencies ++= {if (scalaVersion.value startsWith "3") Seq.empty else Seq(
77-
kanelaAgent % `Compile-Akka-2.5`,
78-
scalatest % `Test-Akka-2.5`,
79-
logbackClassic % `Test-Akka-2.5`,
80-
"com.typesafe.akka" %% "akka-actor" % `Akka-2.5-version` % `Compile-Akka-2.5`,
81-
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.5-version` % `Compile-Akka-2.5`,
82-
"com.typesafe.akka" %% "akka-slf4j" % `Akka-2.5-version` % `Compile-Akka-2.5`,
83-
"com.typesafe.akka" %% "akka-remote" % `Akka-2.5-version` % `Compile-Akka-2.5`,
84-
"com.typesafe.akka" %% "akka-cluster" % `Akka-2.5-version` % `Compile-Akka-2.5`,
85-
"com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.5-version` % `Compile-Akka-2.5`,
86-
"com.typesafe.akka" %% "akka-protobuf" % `Akka-2.5-version` % `Compile-Akka-2.5`,
87-
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.5-version` % `Test-Akka-2.5`
88-
)}
80+
libraryDependencies ++= {
81+
if (scalaVersion.value startsWith "3") Seq.empty
82+
else Seq(
83+
kanelaAgent % `Compile-Akka-2.5`,
84+
scalatest % `Test-Akka-2.5`,
85+
logbackClassic % `Test-Akka-2.5`,
86+
"com.typesafe.akka" %% "akka-actor" % `Akka-2.5-version` % `Compile-Akka-2.5`,
87+
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.5-version` % `Compile-Akka-2.5`,
88+
"com.typesafe.akka" %% "akka-slf4j" % `Akka-2.5-version` % `Compile-Akka-2.5`,
89+
"com.typesafe.akka" %% "akka-remote" % `Akka-2.5-version` % `Compile-Akka-2.5`,
90+
"com.typesafe.akka" %% "akka-cluster" % `Akka-2.5-version` % `Compile-Akka-2.5`,
91+
"com.typesafe.akka" %% "akka-cluster-sharding" % `Akka-2.5-version` % `Compile-Akka-2.5`,
92+
"com.typesafe.akka" %% "akka-protobuf" % `Akka-2.5-version` % `Compile-Akka-2.5`,
93+
"com.typesafe.akka" %% "akka-testkit" % `Akka-2.5-version` % `Test-Akka-2.5`
94+
)
95+
}
8996

9097
// Ensure that the packaged artifact contains the instrumentation for all Akka versions.
9198
Compile / packageBin / mappings := Def.taskDyn {
92-
if(scalaBinaryVersion.value == "2.11") {
99+
if (scalaBinaryVersion.value == "2.11") {
93100
Def.task {
94101
joinProducts((`Compile-Akka-2.5` / products).value) ++
95102
joinProducts((Common / unmanagedResourceDirectories).value)
96103
}
97104
} else if (scalaVersion.value startsWith "3") {
98105
Def.task {
99-
joinProducts((`Compile-Akka-2.6` / products).value) ++
106+
joinProducts((`Compile-Akka-2.6` / products).value) ++
100107
joinProducts((Common / unmanagedResourceDirectories).value)
101108
}
102109
} else {
103110
Def.task {
104111
joinProducts(
105112
(`Compile-Akka-2.5` / products).value ++
106113
(`Compile-Akka-2.6` / products).value
107-
) ++ joinProducts((Common / unmanagedResourceDirectories).value)
114+
) ++ joinProducts((Common / unmanagedResourceDirectories).value)
108115
}
109116
}
110117
}.value
111118

112119
// Ensure that the packaged sources contains the instrumentation for all Akka versions.
113120
Compile / packageSrc / mappings := Def.taskDyn {
114-
if(scalaBinaryVersion.value == "2.11") {
121+
if (scalaBinaryVersion.value == "2.11") {
115122
Def.task {
116123
(`Compile-Akka-2.5` / packageSrc / mappings).value ++
117124
(Common / packageSrc / mappings).value
118-
}
125+
}
119126
} else if (scalaVersion.value startsWith "3") {
120127
Def.task {
121-
(`Compile-Akka-2.6` / packageSrc / mappings).value ++
128+
(`Compile-Akka-2.6` / packageSrc / mappings).value ++
122129
(Common / packageSrc / mappings).value
123130
}
124131
} else {
@@ -128,19 +135,19 @@ Compile / packageSrc / mappings := Def.taskDyn {
128135
(Common / packageSrc / mappings).value
129136
}
130137
}
131-
}.value
138+
}.value
132139

133140
// Compile will return the compile analysis for the Common configuration but will run on all Akka configurations.
134141
Compile / compile := Def.taskDyn {
135-
if(scalaBinaryVersion.value == "2.11") {
142+
if (scalaBinaryVersion.value == "2.11") {
136143
Def.task {
137144
(`Compile-Akka-2.5` / compile).value
138145
}
139-
} else if (scalaVersion.value startsWith "3"){
146+
} else if (scalaVersion.value startsWith "3") {
140147

141148
Def.task {
142149
(`Compile-Akka-2.6` / compile).value
143-
}
150+
}
144151
} else {
145152
Def.task {
146153
(`Compile-Akka-2.5` / compile).value
@@ -151,7 +158,6 @@ Compile / compile := Def.taskDyn {
151158

152159
exportJars := true
153160

154-
155161
/**
156162
* Test-related settings
157163
*/
@@ -181,19 +187,18 @@ inConfig(`Test-Akka-2.6`)(Defaults.testSettings ++ instrumentationSettings ++ ba
181187
))
182188

183189
Test / test := Def.taskDyn {
184-
if(scalaBinaryVersion.value == "2.11") {
190+
if (scalaBinaryVersion.value == "2.11") {
185191
Def.task {
186192
(`Test-Akka-2.5` / test).value
187193
}
188194
} else if (scalaVersion.value startsWith "3") {
189195
Def.task {
190196
(`Test-Akka-2.6` / test).value
191197
}
192-
}
193-
else {
198+
} else {
194199
Def.task {
195200
(`Test-Akka-2.5` / test).value
196201
(`Test-Akka-2.6` / test).value
197202
}
198203
}
199-
}.value
204+
}.value

instrumentation/kamon-cassandra/build.sbt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
lazy val Cassandra3xTest = config("testCas3") extend(Test)
2-
lazy val Cassandra4xTest = config("testCas4") extend(Test)
1+
lazy val Cassandra3xTest = config("testCas3") extend (Test)
2+
lazy val Cassandra4xTest = config("testCas4") extend (Test)
33

44
val cassandra3xDriverVersion = "3.10.0"
55
val cassandra4xDriverVersion = "4.10.0"
@@ -16,15 +16,15 @@ libraryDependencies ++= Seq(
1616
)
1717

1818
libraryDependencies ++= Seq(
19-
"com.datastax.oss" % "java-driver-core" % cassandra4xDriverVersion % "provided,testCas4",
20-
"com.datastax.oss" % "java-driver-query-builder" % cassandra4xDriverVersion % "provided,testCas4"
19+
"com.datastax.oss" % "java-driver-core" % cassandra4xDriverVersion % "provided,testCas4",
20+
"com.datastax.oss" % "java-driver-query-builder" % cassandra4xDriverVersion % "provided,testCas4"
2121
)
2222

2323
configs(Cassandra3xTest, Cassandra4xTest)
2424
inConfig(Cassandra3xTest)(Defaults.testSettings)
2525
inConfig(Cassandra4xTest)(Defaults.testSettings)
2626

27-
Test / test := {
27+
Test / test := {
2828
(Cassandra3xTest / test).value
2929
(Cassandra4xTest / test).value
3030
}

instrumentation/kamon-executors/build.sbt

+23-14
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,30 @@ import sbt.Tests.{Group, SubProcess}
33
Test / testGrouping := groupByExperimentalExecutorTests((Test / definedTests).value, kanelaAgentJar.value)
44

55
def groupByExperimentalExecutorTests(tests: Seq[TestDefinition], kanelaJar: File): Seq[Group] = {
6-
val (stable, experimental) = tests.partition(t => t.name != "kamon.instrumentation.executor.CaptureContextOnSubmitInstrumentationSpec")
6+
val (stable, experimental) =
7+
tests.partition(t => t.name != "kamon.instrumentation.executor.CaptureContextOnSubmitInstrumentationSpec")
78

8-
val stableGroup = Group("stableTests", stable, SubProcess(
9-
ForkOptions().withRunJVMOptions(Vector(
10-
"-javaagent:" + kanelaJar.toString
11-
))
12-
))
9+
val stableGroup = Group(
10+
"stableTests",
11+
stable,
12+
SubProcess(
13+
ForkOptions().withRunJVMOptions(Vector(
14+
"-javaagent:" + kanelaJar.toString
15+
))
16+
)
17+
)
1318

14-
val experimentalGroup = Group("experimentalTests", experimental, SubProcess(
15-
ForkOptions().withRunJVMOptions(Vector(
16-
"-javaagent:" + kanelaJar.toString,
17-
"-Dkanela.modules.executor-service.enabled=false",
18-
"-Dkanela.modules.executor-service-capture-on-submit.enabled=true"
19-
))
20-
))
19+
val experimentalGroup = Group(
20+
"experimentalTests",
21+
experimental,
22+
SubProcess(
23+
ForkOptions().withRunJVMOptions(Vector(
24+
"-javaagent:" + kanelaJar.toString,
25+
"-Dkanela.modules.executor-service.enabled=false",
26+
"-Dkanela.modules.executor-service-capture-on-submit.enabled=true"
27+
))
28+
)
29+
)
2130

2231
Seq(stableGroup, experimentalGroup)
23-
}
32+
}

instrumentation/kamon-pekko/build.sbt

+17-14
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ inConfig(Compile)(Defaults.compileSettings ++ Seq(
55
))
66

77
val pekkoVersion = "1.0.1"
8-
libraryDependencies ++= { if(scalaBinaryVersion.value == "2.11") Seq.empty else Seq(
9-
kanelaAgent % "provided",
10-
scalatest % Test,
11-
logbackClassic % Test,
12-
"org.apache.pekko" %% "pekko-actor" % pekkoVersion % "provided,test",
13-
"org.apache.pekko" %% "pekko-testkit" % pekkoVersion % "provided,test",
14-
"org.apache.pekko" %% "pekko-slf4j" % pekkoVersion % "provided,test",
15-
"org.apache.pekko" %% "pekko-remote" % pekkoVersion % "provided,test",
16-
"org.apache.pekko" %% "pekko-cluster" % pekkoVersion % "provided,test",
17-
"org.apache.pekko" %% "pekko-cluster-sharding" % pekkoVersion % "provided,test",
18-
"org.apache.pekko" %% "pekko-protobuf" % pekkoVersion % "provided,test",
19-
"org.apache.pekko" %% "pekko-testkit" % pekkoVersion % Test
20-
)}
8+
libraryDependencies ++= {
9+
if (scalaBinaryVersion.value == "2.11") Seq.empty
10+
else Seq(
11+
kanelaAgent % "provided",
12+
scalatest % Test,
13+
logbackClassic % Test,
14+
"org.apache.pekko" %% "pekko-actor" % pekkoVersion % "provided,test",
15+
"org.apache.pekko" %% "pekko-testkit" % pekkoVersion % "provided,test",
16+
"org.apache.pekko" %% "pekko-slf4j" % pekkoVersion % "provided,test",
17+
"org.apache.pekko" %% "pekko-remote" % pekkoVersion % "provided,test",
18+
"org.apache.pekko" %% "pekko-cluster" % pekkoVersion % "provided,test",
19+
"org.apache.pekko" %% "pekko-cluster-sharding" % pekkoVersion % "provided,test",
20+
"org.apache.pekko" %% "pekko-protobuf" % pekkoVersion % "provided,test",
21+
"org.apache.pekko" %% "pekko-testkit" % pekkoVersion % Test
22+
)
23+
}
2124

2225
exportJars := true
2326

@@ -33,5 +36,5 @@ lazy val baseTestSettings = Seq(
3336
)
3437

3538
inConfig(Test)(Defaults.testSettings ++ instrumentationSettings ++ baseTestSettings ++ Seq(
36-
crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version),
39+
crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`, scala_3_version)
3740
))

0 commit comments

Comments
 (0)