Skip to content

Update scalafmt-core to 3.8.4 #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.7.17
98879bf22a5e11b4adf2047825c9efa0b9a22428

# Scala Steward: Reformat with scalafmt 3.8.4
2408d1e1bc244c7475e6bc184d43c6a49fed4a61
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.7.17"
version = "3.8.4"

runner.dialect=scala213source3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ object CodecsTest extends SimpleIOSuite {
val outcomes = for {
entry <- entries
result <- results
} yield TestOutcome.Default("outcome", 1.second, result, Chain.fromSeq(entries))
} yield TestOutcome.Default("outcome",
1.second,
result,
Chain.fromSeq(entries))

val messages =
List(SuiteStarts("foo")) ++
Expand Down
4 changes: 2 additions & 2 deletions modules/core/shared/src/main/scala-3/weaver/ExpectMacro.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private[weaver] object ExpectMacro {
* contruct [[Expectations]].
*/
def applyImpl[T: Type](assertion: Expr[Clues ?=> Boolean])(using
q: Quotes): Expr[Expectations] = {
q: Quotes): Expr[Expectations] = {
val sourceLoc = weaver.macros.fromContextImpl(using q)
'{
val clues = new Clues
Expand Down Expand Up @@ -81,7 +81,7 @@ private[weaver] object ExpectMacro {
* part of the failed expectation.
*/
def allImpl[T: Type](assertions: Expr[Seq[(Clues ?=> Boolean)]])(using
q: Quotes): Expr[Expectations] = {
q: Quotes): Expr[Expectations] = {
val sourceLoc = weaver.macros.fromContextImpl(using q)
'{
val clues = new Clues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ object GlobalResourceF {

def putLazyR[A](
resource: Resource[F, A],
label: Option[String] = None)(implicit
rt: ResourceTag[A]): Resource[F, Unit] =
label: Option[String] =
None)(implicit rt: ResourceTag[A]): Resource[F, Unit] =
Resource.eval(putLazy(resource, label))
}

Expand Down Expand Up @@ -114,7 +114,7 @@ object GlobalResourceF {
implicit protected def F: MonadError[F, Throwable] = effect

protected def rawGet[A](label: Option[String])(implicit
rt: ResourceTag[A]): F[Option[Either[A, Resource[F, A]]]] =
rt: ResourceTag[A]): F[Option[Either[A, Resource[F, A]]]] =
effect.pure(None)
}
}
Expand Down
3 changes: 1 addition & 2 deletions modules/framework-cats/jvm/src/test/scala/MetaJVM.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ object MetaJVM {
initialised <- Ref[IO].of(0)
finalised <- Ref[IO].of(0)
totalUses <- Ref[IO].of(0)

/**
* NOTE: the number 3 refers to the current number of instantiated
* suites in the DogFoodTestsJVM spec, tests involving "global lazy
Expand All @@ -81,9 +82,7 @@ object MetaJVM {
*
* - Change the number of LazyAccessParallel suites in "global lazy
* resources (parallel)" test
*
* - Change the number below
*
* - Add another test to the LazyAccessParallel spec below
*
* You are very likely to face a very confusing non-deterministic
Expand Down
21 changes: 14 additions & 7 deletions modules/framework-cats/shared/src/test/scala/DogFoodTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ object DogFoodTests extends IOSuite {
case LoggedEvent.Error(msg) => msg
}.get

val expected = s"""
val expected =
s"""
|- lots 0ms
| of
| multiline
Expand Down Expand Up @@ -323,7 +324,8 @@ object DogFoodTests extends IOSuite {
msg
}.get

val expected = s"""
val expected =
s"""
|- (failure) 0ms
| assertion failed (modules/framework-cats/shared/src/test/scala/Meta.scala:83)
|
Expand All @@ -346,7 +348,8 @@ object DogFoodTests extends IOSuite {
msg
}.get

val expected = s"""
val expected =
s"""
|- (nested) 0ms
| assertion failed (modules/framework-cats/shared/src/test/scala/Meta.scala:89)
|
Expand All @@ -370,7 +373,8 @@ object DogFoodTests extends IOSuite {
msg
}.get

val expected = s"""
val expected =
s"""
|- (map) 0ms
| assertion failed (modules/framework-cats/shared/src/test/scala/Meta.scala:95)
|
Expand All @@ -393,7 +397,8 @@ object DogFoodTests extends IOSuite {
msg
}.get

val expected = s"""
val expected =
s"""
|- (show) 0ms
| assertion failed (modules/framework-cats/shared/src/test/scala/Meta.scala:102)
|
Expand All @@ -417,7 +422,8 @@ object DogFoodTests extends IOSuite {
msg
}.get

val expected = s"""
val expected =
s"""
|- (show-from-to-string) 0ms
| assertion failed (modules/framework-cats/shared/src/test/scala/Meta.scala:112)
|
Expand All @@ -439,7 +445,8 @@ object DogFoodTests extends IOSuite {
msg
}.get

val expected = s"""
val expected =
s"""
|- (helpers) 0ms
| assertion failed (modules/framework-cats/shared/src/test/scala/Meta.scala:121)
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object TestOutcomeEncodingTests
)

private def roundtripTest(name: TestName, input: TestOutcomeNative)(implicit
loc: SourceLocation) = {
loc: SourceLocation) = {

test(name.copy(name = "Roundtrip test - " + name.name)) {
val encoded = TestOutcomeNative.encode(input)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
rule = RenameAssertToExpect
*/
*/
package fix
import weaver._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ object RenameAssertToExpectTest extends SimpleIOSuite {
not(expect(2 == 1) xor expect(1 == 2))
}
}

22 changes: 12 additions & 10 deletions scalafix/project/TargetAxis.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,32 @@ object TargetAxis {
private def targetScalaVersion(virtualAxes: Seq[VirtualAxis]): String =
virtualAxes.collectFirst { case a: TargetAxis => a.scalaVersion }.get

/** When invoked on a ProjectMatrix with a TargetAxis, lookup the project
* generated by `matrix` with a scalaVersion matching the one declared in
* that TargetAxis, and resolve `key`.
*/
/**
* When invoked on a ProjectMatrix with a TargetAxis, lookup the project
* generated by `matrix` with a scalaVersion matching the one declared in that
* TargetAxis, and resolve `key`.
*/
def resolve[T](
matrix: ProjectMatrix,
key: TaskKey[T]
): Def.Initialize[Task[T]] =
Def.taskDyn {
val sv = targetScalaVersion(virtualAxes.value)
val sv = targetScalaVersion(virtualAxes.value)
val project = matrix.finder().apply(sv)
Def.task((project / key).value)
}

/** When invoked on a ProjectMatrix with a TargetAxis, lookup the project
* generated by `matrix` with a scalaVersion matching the one declared in
* that TargetAxis, and resolve `key`.
*/
/**
* When invoked on a ProjectMatrix with a TargetAxis, lookup the project
* generated by `matrix` with a scalaVersion matching the one declared in that
* TargetAxis, and resolve `key`.
*/
def resolve[T](
matrix: ProjectMatrix,
key: SettingKey[T]
): Def.Initialize[T] =
Def.settingDyn {
val sv = targetScalaVersion(virtualAxes.value)
val sv = targetScalaVersion(virtualAxes.value)
val project = matrix.finder().apply(sv)
Def.setting((project / key).value)
}
Expand Down
4 changes: 2 additions & 2 deletions scalafix/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
resolvers += Resolver.sonatypeRepo("releases")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.2")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.2")
3 changes: 2 additions & 1 deletion scalafix/rules/src/main/scala/fix/RenameAssertToExpect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import scalafix.v1._
class RenameAssertToExpect extends SemanticRule("RenameAssertToExpect") {

override def fix(implicit doc: SemanticDocument): Patch = {
val assertMethod = SymbolMatcher.normalized("weaver/Expectations.Helpers#assert.")
val assertMethod =
SymbolMatcher.normalized("weaver/Expectations.Helpers#assert.")
doc.tree.collect {
case assertMethod(tree) => Patch.renameSymbol(tree.symbol, "expect")
}.asPatch
Expand Down
Loading