Skip to content

Commit 6daf37c

Browse files
Update scalafmt-core to 3.9.7 (#564)
* Update scalafmt-core to 3.9.7 * Reformat with scalafmt 3.9.7 Executed command: scalafmt --non-interactive * Add 'Reformat with scalafmt 3.9.7' to .git-blame-ignore-revs
1 parent cbc3f87 commit 6daf37c

File tree

20 files changed

+58
-55
lines changed

20 files changed

+58
-55
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ ff8ca52d610ca63ee0ab4fcfb5d79da13a1250b1
66

77
# Scala Steward: Reformat with scalafmt 3.8.6
88
c038644e07f224e668b7be8c53f9038cfd2275cf
9+
10+
# Scala Steward: Reformat with scalafmt 3.9.7
11+
6140c78f063f429304c3195435068432de309492

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ rewrite.rules = [RedundantBraces, RedundantParens, SortImports]
77
spaces.inImportCurlyBraces = true
88
indentOperator.preset = spray
99

10-
version=3.9.6
10+
version=3.9.7
1111

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ lazy val commonSettings =
5454
lazy val publishSettings = Seq(
5555
licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")),
5656
homepage := Some(url("https://github.com/mockito/mockito-scala")),
57-
scmInfo := Some(
57+
scmInfo := Some(
5858
ScmInfo(
5959
url("https://github.com/mockito/mockito-scala"),
6060
"git@github.com:mockito/mockito-scala.git"
@@ -113,7 +113,7 @@ lazy val cats = (project in file("cats"))
113113
publishSettings,
114114
libraryDependencies ++= Seq(
115115
Dependencies.cats,
116-
Dependencies.catsLaws % "test",
116+
Dependencies.catsLaws % "test",
117117
Dependencies.disciplineScalatest % "test",
118118
Dependencies.scalatest % "test"
119119
)

common/src/main/scala/org/mockito/ReflectionUtils.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object ReflectionUtils {
2424

2525
implicit def symbolToMethodSymbol(sym: Symbol): Symbols#MethodSymbol = sym.asInstanceOf[Symbols#MethodSymbol]
2626

27-
private val mirror = runtimeMirror(getClass.getClassLoader)
27+
private val mirror = runtimeMirror(getClass.getClassLoader)
2828
private val customMirror = mirror.asInstanceOf[{
2929
def methodToJava(sym: Symbols#MethodSymbol): Method
3030
}]
@@ -130,7 +130,7 @@ object ReflectionUtils {
130130
field.setAccessible(true)
131131
val modifiersField: Field = uTry(clazz.getDeclaredField("modifiers")) match {
132132
case Success(modifiers) => modifiers
133-
case Failure(e) =>
133+
case Failure(e) =>
134134
uTry {
135135
val getDeclaredFields0 = clazz.getDeclaredMethod("getDeclaredFields0", classOf[Boolean])
136136
val accessibleBeforeSet: Boolean = getDeclaredFields0.isAccessible
@@ -142,7 +142,7 @@ object ReflectionUtils {
142142
declaredFields.find("modifiers" == _.getName).get
143143
} match {
144144
case Success(modifiers) => modifiers
145-
case Failure(ex) =>
145+
case Failure(ex) =>
146146
e.addSuppressed(ex)
147147
throw e
148148
}

common/src/main/scala/org/mockito/internal/handler/ScalaMockHandler.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ScalaMockHandler[T](mockSettings: MockCreationSettings[T], methodsToProces
2727
i.callRealMethod()
2828
else {
2929
val rawArguments = i.getRawArguments
30-
val arguments =
30+
val arguments =
3131
if (rawArguments != null && rawArguments.nonEmpty && !isCallRealMethod) unwrapArgs(method, rawArguments)
3232
else rawArguments
3333

@@ -42,18 +42,18 @@ class ScalaMockHandler[T](mockSettings: MockCreationSettings[T], methodsToProces
4242
val transformed = methodsToProcess
4343
.collectFirst {
4444
case (mtd, indices) if method === mtd =>
45-
val argumentMatcherStorage = mockingProgress().getArgumentMatcherStorage
46-
val matchers = argumentMatcherStorage.pullLocalizedMatchers().asScala.toIterator
47-
val matchersWereUsed = matchers.nonEmpty
48-
def reportMatcher(): Unit = if (matchers.nonEmpty) argumentMatcherStorage.reportMatcher(matchers.next().getMatcher)
45+
val argumentMatcherStorage = mockingProgress().getArgumentMatcherStorage
46+
val matchers = argumentMatcherStorage.pullLocalizedMatchers().asScala.toIterator
47+
val matchersWereUsed = matchers.nonEmpty
48+
def reportMatcher(): Unit = if (matchers.nonEmpty) argumentMatcherStorage.reportMatcher(matchers.next().getMatcher)
4949
def reportMatchers(varargs: Iterable[_]): Unit =
5050
if (matchersWereUsed && varargs.nonEmpty) {
5151
def reportAsEqTo(): Unit = varargs.map(EqTo(_)).foreach(argumentMatcherStorage.reportMatcher(_))
5252
val matcher = matchers.next().getMatcher
5353
matcher match {
5454
case EqTo(value: Array[_]) if varargs.sameElements(value) => reportAsEqTo()
5555
case EqTo(value) if varargs == value => reportAsEqTo()
56-
case other =>
56+
case other =>
5757
argumentMatcherStorage.reportMatcher(other)
5858
varargs.drop(1).foreach(_ => reportMatcher())
5959
}
@@ -100,7 +100,7 @@ object ScalaMockHandler {
100100
mockSettings
101101
)
102102

103-
private val InvocationClassName = classOf[ScalaInvocation].getName
103+
private val InvocationClassName = classOf[ScalaInvocation].getName
104104
private def isCallRealMethod: Boolean =
105105
(new Exception).getStackTrace.toList.exists { t =>
106106
t.getClassName == InvocationClassName &&

common/src/main/scala/org/mockito/internal/invocation/ScalaInvocation.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ScalaInvocation(
4545
override def isVerified: Boolean = verified || isIgnoredForVerification
4646
override def getMock: AnyRef = mockRef.get
4747
override def getMethod: Method = mockitoMethod.getJavaMethod
48-
override def callRealMethod(): AnyRef =
48+
override def callRealMethod(): AnyRef =
4949
if (realMethod.isInvokable) realMethod.invoke
5050
else throw cannotCallAbstractRealMethod
5151

@@ -62,7 +62,7 @@ class ScalaInvocation(
6262
val state = Seq(super.hashCode(), getMock, mockitoMethod, arguments.toSeq)
6363
state.map(_.hashCode()).foldLeft(0)((a, b) => 31 * a + b)
6464
}
65-
override def toString: String = new PrintSettings().print(getArgumentsAsMatchers, this)
65+
override def toString: String = new PrintSettings().print(getArgumentsAsMatchers, this)
6666
override def getArgumentsAsMatchers: util.List[ArgumentMatcher[_]] =
6767
arguments.map(EqTo(_)(serialisableEquality[AnyRef], ValueClassExtractor.instance[AnyRef], $pt): ArgumentMatcher[_]).toList.asJava
6868
}

common/src/main/scala/org/mockito/stubbing/ScalaBaseStubbing.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract class ScalaBaseStubbing[T: ValueClassExtractor] {
2929

3030
protected def _thenCallRealMethod(): ScalaOngoingStubbing[T] = delegate.thenCallRealMethod()
3131

32-
protected def _thenAnswer(f: => T): ScalaOngoingStubbing[T] = delegate thenAnswer invocationToAnswer(_ => f)
32+
protected def _thenAnswer(f: => T): ScalaOngoingStubbing[T] = delegate thenAnswer invocationToAnswer(_ => f)
3333
protected def _thenAnswer[P0: ClassTag: ValueClassWrapper](f: P0 => T): ScalaOngoingStubbing[T] =
3434
clazz[P0] match {
3535
case c if c == classOf[InvocationOnMock] => delegate thenAnswer invocationToAnswer(i => f(i.asInstanceOf[P0]))

common/src/main/scala/org/mockito/stubbing/ScalaFirstStubbing.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ case class ScalaFirstStubbing[T: ValueClassExtractor](delegate: OngoingStubbing[
9898
}
9999
}
100100

101-
def thenAnswer(f: => T): ScalaOngoingStubbing[T] = _thenAnswer(f)
101+
def thenAnswer(f: => T): ScalaOngoingStubbing[T] = _thenAnswer(f)
102102
def thenAnswer[P0: ValueClassWrapper](f: P0 => T)(implicit classTag: ClassTag[P0] = defaultClassTag[P0]): ScalaOngoingStubbing[T] =
103103
_thenAnswer(f)
104104
def thenAnswer[P0: ValueClassWrapper, P1: ValueClassWrapper](f: (P0, P1) => T): ScalaOngoingStubbing[T] =

common/src/main/scala/org/mockito/stubbing/ScalaOngoingStubbing.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ case class ScalaOngoingStubbing[T: ValueClassExtractor](delegate: OngoingStubbin
7878
*/
7979
def andThenCallRealMethod(): ScalaOngoingStubbing[T] = _thenCallRealMethod()
8080

81-
def andThenAnswer(f: => T): ScalaOngoingStubbing[T] = _thenAnswer(f)
81+
def andThenAnswer(f: => T): ScalaOngoingStubbing[T] = _thenAnswer(f)
8282
def andThenAnswer[P0: ValueClassWrapper](f: P0 => T)(implicit classTag: ClassTag[P0] = defaultClassTag[P0]): ScalaOngoingStubbing[T] =
8383
_thenAnswer(f)
8484
def andThenAnswer[P0: ValueClassWrapper, P1: ValueClassWrapper](f: (P0, P1) => T): ScalaOngoingStubbing[T] =

core/src/main/scala/org/mockito/IdiomaticMockitoBase.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object IdiomaticMockitoBase {
3232

3333
case class Times(times: Int) extends ScalaVerificationMode {
3434
override def verificationMode: VerificationMode = Mockito.times(times)
35-
def within(d: Duration): ScalaVerificationMode =
35+
def within(d: Duration): ScalaVerificationMode =
3636
new ScalaVerificationMode {
3737
override def verificationMode: VerificationMode = Mockito.timeout(d.toMillis).times(times)
3838
}
@@ -53,7 +53,7 @@ object IdiomaticMockitoBase {
5353

5454
case class AtLeast(times: Int) extends ScalaVerificationMode {
5555
override def verificationMode: VerificationMode = Mockito.atLeast(times)
56-
def within(d: Duration): ScalaVerificationMode =
56+
def within(d: Duration): ScalaVerificationMode =
5757
new ScalaVerificationMode {
5858
override def verificationMode: VerificationMode = Mockito.timeout(d.toMillis).atLeast(times)
5959
}
@@ -65,15 +65,15 @@ object IdiomaticMockitoBase {
6565

6666
case class AtMost(times: Int) extends ScalaVerificationMode {
6767
override def verificationMode: VerificationMode = Mockito.atMost(times)
68-
def after(d: Duration): ScalaVerificationMode =
68+
def after(d: Duration): ScalaVerificationMode =
6969
new ScalaVerificationMode {
7070
override def verificationMode: VerificationMode = Mockito.after(d.toMillis).atMost(times)
7171
}
7272
}
7373

7474
object OnlyOn extends ScalaVerificationMode {
7575
override def verificationMode: VerificationMode = Mockito.only
76-
def within(d: Duration): ScalaVerificationMode =
76+
def within(d: Duration): ScalaVerificationMode =
7777
new ScalaVerificationMode {
7878
override def verificationMode: VerificationMode = Mockito.timeout(d.toMillis).only
7979
}

0 commit comments

Comments
 (0)