Skip to content

Commit e8d8417

Browse files
authored
Merge pull request #169 from scala-steward/update/scalafmt-core-3.0.0
Update scalafmt-core to 3.0.0
2 parents 24fd501 + a9bc0f9 commit e8d8417

4 files changed

Lines changed: 79 additions & 68 deletions

File tree

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 2.7.5
1+
version = 3.0.0
22

33
style = default
44

build.sbt

Lines changed: 71 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
2828
List(CrossType.Pure, CrossType.Full).flatMap(
2929
_.sharedSrcDir(baseDirectory.value, "main").toList.map(f => file(f.getPath + major))
3030
)
31-
},
31+
}
3232
)
3333

3434
lazy val testing = crossProject(JSPlatform, JVMPlatform)
@@ -55,17 +55,20 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform)
5555
name := "case-insensitive-tests",
5656
libraryDependencies ++= Seq(
5757
"org.typelevel" %%% "cats-laws" % catsV,
58-
"org.typelevel" %%% "discipline-munit" % disciplineMunitV,
58+
"org.typelevel" %%% "discipline-munit" % disciplineMunitV
5959
).map(_ % Test)
6060
)
6161
.jvmSettings(
6262
Test / testGrouping := {
6363
val (turkish, english) = (Test / definedTests).value.partition(_.name.contains("Turkey"))
6464
def group(language: String, tests: Seq[TestDefinition]) =
65-
new Group(language, tests, SubProcess(ForkOptions().withRunJVMOptions(Vector(s"-Duser.language=${language}"))))
65+
new Group(
66+
language,
67+
tests,
68+
SubProcess(ForkOptions().withRunJVMOptions(Vector(s"-Duser.language=$language"))))
6669
List(
6770
group("en", english),
68-
group("tr", turkish),
71+
group("tr", turkish)
6972
)
7073
}
7174
)
@@ -77,17 +80,18 @@ lazy val bench = project
7780
.enablePlugins(JmhPlugin)
7881
.settings(commonSettings)
7982
.settings(
80-
name := "case-insensitive-bench",
83+
name := "case-insensitive-bench"
8184
)
8285
.dependsOn(core.jvm)
8386

84-
lazy val site = project.in(file("site"))
87+
lazy val site = project
88+
.in(file("site"))
8589
.enablePlugins(MicrositesPlugin)
8690
.enablePlugins(MdocPlugin)
8791
.enablePlugins(NoPublishPlugin)
8892
.settings(commonSettings)
8993
.dependsOn(core.jvm, testing.jvm)
90-
.settings{
94+
.settings {
9195
import microsites._
9296
Seq(
9397
micrositeName := "case-insensitive",
@@ -112,10 +116,16 @@ lazy val site = project.in(file("site"))
112116
),
113117
micrositePushSiteWith := GHPagesPlugin,
114118
micrositeExtraMdFiles := Map(
115-
file("CODE_OF_CONDUCT.md") -> ExtraMdFileConfig("code-of-conduct.md", "page", Map("title" -> "code of conduct", "section" -> "code of conduct", "position" -> "100")),
116-
file("LICENSE") -> ExtraMdFileConfig("license.md", "page", Map("title" -> "license", "section" -> "license", "position" -> "101"))
119+
file("CODE_OF_CONDUCT.md") -> ExtraMdFileConfig(
120+
"code-of-conduct.md",
121+
"page",
122+
Map("title" -> "code of conduct", "section" -> "code of conduct", "position" -> "100")),
123+
file("LICENSE") -> ExtraMdFileConfig(
124+
"license.md",
125+
"page",
126+
Map("title" -> "license", "section" -> "license", "position" -> "101"))
117127
),
118-
githubWorkflowArtifactUpload := false,
128+
githubWorkflowArtifactUpload := false
119129
),
120130
}
121131

@@ -128,53 +138,54 @@ val Scala213 = "2.13.6"
128138
val Scala213Cond = s"matrix.scala == '$Scala213'"
129139

130140
// General Settings
131-
inThisBuild(List(
132-
organization := "org.typelevel",
133-
organizationName := "Typelevel",
134-
publishGithubUser := "rossabaker",
135-
publishFullName := "Ross A. Baker",
136-
baseVersion := "1.1",
137-
138-
crossScalaVersions := Seq("2.12.14", Scala213, "3.0.1"),
139-
scalaVersion := crossScalaVersions.value.filter(_.startsWith("2.")).last,
140-
versionIntroduced := Map(
141-
"3.0.0-RC1" -> "1.0.0",
142-
"3.0.0-RC2" -> "1.0.1",
143-
"3.0.0-RC3" -> "1.1.3"
144-
),
145-
146-
homepage := Some(url("https://github.com/typelevel/case-insensitive")),
147-
startYear := Some(2020),
148-
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")),
149-
scmInfo := Some(ScmInfo(url("https://github.com/typelevel/case-insensitive"),
150-
"git@github.com:typelevel/case-insensitive.git")),
151-
152-
githubWorkflowTargetTags ++= Seq("v*"),
153-
githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v"))),
154-
githubWorkflowBuildPreamble ++= Seq(
155-
WorkflowStep.Use(UseRef.Public("actions", "setup-ruby", "v1"), params = Map("ruby-version" -> "2.7")),
156-
WorkflowStep.Run(List(
157-
"gem install bundler",
158-
"bundle install --gemfile=site/Gemfile"
159-
), name = Some("Install Jekyll"))
160-
),
161-
githubWorkflowBuild +=
162-
WorkflowStep.Sbt(
163-
List(s"++${Scala213}", "site/makeMicrosite"),
164-
cond = Some(Scala213Cond)),
165-
githubWorkflowPublish := Seq(
166-
WorkflowStep.Sbt(List("release")),
167-
WorkflowStep.Run(List(
168-
"""eval "$(ssh-agent -s)"""",
169-
"""echo "$SSH_PRIVATE_KEY" | ssh-add -""",
170-
"""git config --global user.name "GitHub Actions CI"""",
171-
"""git config --global user.email "ghactions@invalid""""
172-
)),
173-
WorkflowStep.Sbt(List("++${Scala213}", "site/publishMicrosite"),
174-
name = Some(s"Publish microsite"),
175-
env = Map("SSH_PRIVATE_KEY" -> "${{ secrets.SSH_PRIVATE_KEY }}"))
176-
),
177-
178-
testFrameworks += new TestFramework("munit.Framework"),
179-
Test / scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }
180-
))
141+
inThisBuild(
142+
List(
143+
organization := "org.typelevel",
144+
organizationName := "Typelevel",
145+
publishGithubUser := "rossabaker",
146+
publishFullName := "Ross A. Baker",
147+
baseVersion := "1.1",
148+
crossScalaVersions := Seq("2.12.14", Scala213, "3.0.1"),
149+
scalaVersion := crossScalaVersions.value.filter(_.startsWith("2.")).last,
150+
versionIntroduced := Map(
151+
"3.0.0-RC1" -> "1.0.0",
152+
"3.0.0-RC2" -> "1.0.1",
153+
"3.0.0-RC3" -> "1.1.3"
154+
),
155+
homepage := Some(url("https://github.com/typelevel/case-insensitive")),
156+
startYear := Some(2020),
157+
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")),
158+
scmInfo := Some(
159+
ScmInfo(
160+
url("https://github.com/typelevel/case-insensitive"),
161+
"git@github.com:typelevel/case-insensitive.git")),
162+
githubWorkflowTargetTags ++= Seq("v*"),
163+
githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v"))),
164+
githubWorkflowBuildPreamble ++= Seq(
165+
WorkflowStep
166+
.Use(UseRef.Public("actions", "setup-ruby", "v1"), params = Map("ruby-version" -> "2.7")),
167+
WorkflowStep.Run(
168+
List(
169+
"gem install bundler",
170+
"bundle install --gemfile=site/Gemfile"
171+
),
172+
name = Some("Install Jekyll"))
173+
),
174+
githubWorkflowBuild +=
175+
WorkflowStep.Sbt(List(s"++$Scala213", "site/makeMicrosite"), cond = Some(Scala213Cond)),
176+
githubWorkflowPublish := Seq(
177+
WorkflowStep.Sbt(List("release")),
178+
WorkflowStep.Run(List(
179+
"""eval "$(ssh-agent -s)"""",
180+
"""echo "$SSH_PRIVATE_KEY" | ssh-add -""",
181+
"""git config --global user.name "GitHub Actions CI"""",
182+
"""git config --global user.email "ghactions@invalid""""
183+
)),
184+
WorkflowStep.Sbt(
185+
List("++${Scala213}", "site/publishMicrosite"),
186+
name = Some(s"Publish microsite"),
187+
env = Map("SSH_PRIVATE_KEY" -> "${{ secrets.SSH_PRIVATE_KEY }}"))
188+
),
189+
testFrameworks += new TestFramework("munit.Framework"),
190+
Test / scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }
191+
))

core/src/main/scala/org/typelevel/ci/CIString.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ import scala.math.Ordered
1414

1515
/** A case-insensitive String.
1616
*
17-
* Two CI strings are equal if and only if they are the same length, and each
18-
* corresponding character is equal after calling either `toUpper` or
19-
* `toLower`.
17+
* Two CI strings are equal if and only if they are the same length, and each corresponding
18+
* character is equal after calling either `toUpper` or `toLower`.
2019
*
21-
* Ordering is based on a string comparison after folding each
22-
* character to uppercase and then back to lowercase.
20+
* Ordering is based on a string comparison after folding each character to uppercase and then back
21+
* to lowercase.
2322
*
2423
* All comparisons are insensitive to locales.
2524
*
26-
* @param toString The original value the CI String was constructed with.
25+
* @param toString
26+
* The original value the CI String was constructed with.
2727
*/
2828
final class CIString private (override val toString: String)
2929
extends Ordered[CIString]

tests/shared/src/test/scala/org/typelevel/ci/CIStringSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class CIStringSuite extends DisciplineSuite {
125125

126126
property("ci interpolator is consistent with apply") {
127127
forAll { (s: String) =>
128-
assertEquals(ci"${s}", CIString(s))
128+
assertEquals(ci"$s", CIString(s))
129129
}
130130
}
131131

0 commit comments

Comments
 (0)