Skip to content

Commit 7c97e82

Browse files
authored
Update scalafix-core, scalafix-interfaces to 0.11.1
1 parent 14333d8 commit 7c97e82

File tree

6 files changed

+92
-99
lines changed

6 files changed

+92
-99
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: test -f .github/actions.yml && eval "$(yq e '.pre.ci // "true"' .github/actions.yml)" || true
3838
- name: Run scalafmt on Scala Steward PRs
3939
if: github.event.pull_request.user.login == '47erbot' && contains(github.event.pull_request.body, 'Scala Steward')
40-
run: sbt "scalafixEnable; fix" || sbt "scalafmtAll; scalafmtSbt" || true
40+
run: sbt "scalafmtAll; scalafmtSbt" || true
4141
- name: Push changes
4242
uses: stefanzweifel/[email protected]
4343
with:

build.sbt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ThisBuild / scalaVersion := "2.12.17"
1+
ThisBuild / scalaVersion := "2.12.18"
22
ThisBuild / organization := "io.higherkindness"
33
ThisBuild / githubOrganization := "47deg"
44

@@ -17,10 +17,10 @@ lazy val core = project
1717
"com.julianpeeters" %% "avrohugger-core" % "1.6.0",
1818
"com.thesamet.scalapb" %% "compilerplugin" % "0.11.13",
1919
"com.thesamet.scalapb" %% "scalapb-validate-codegen" % "0.3.4",
20-
"org.scalameta" %% "scalameta" % "4.6.0",
21-
"ch.epfl.scala" %% "scalafix-core" % "0.10.4",
22-
"ch.epfl.scala" %% "scalafix-cli" % "0.10.4" cross CrossVersion.full,
23-
"ch.epfl.scala" % "scalafix-interfaces" % "0.10.4",
20+
"org.scalameta" %% "scalameta" % "4.7.6",
21+
"ch.epfl.scala" %% "scalafix-core" % "0.11.1",
22+
"ch.epfl.scala" %% "scalafix-cli" % "0.11.1" cross CrossVersion.full,
23+
"ch.epfl.scala" % "scalafix-interfaces" % "0.11.1",
2424
"org.scalatest" %% "scalatest" % "3.2.17" % Test,
2525
"org.scalacheck" %% "scalacheck" % "1.17.0" % Test,
2626
"org.scalatestplus" %% "scalacheck-1-16" % "3.2.14.0" % Test,

core/src/main/scala/higherkindness/mu/rpc/srcgen/avro/rewrites/AddAvroOrderingAnnotations.scala

+6-4
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,23 @@ class AddAvroOrderingAnnotations extends SyntacticRule("AddAvroOrderingAnnotatio
5353
case Defn.Object(
5454
_,
5555
Term.Name(objName),
56-
Template(
56+
Template.After_4_4_0(
5757
_,
5858
_,
5959
_,
60-
stats
60+
stats,
61+
_
6162
)
6263
) =>
6364
val patches = stats.zipWithIndex.map {
6465
case (
6566
t @ Defn.Object(
6667
mods,
6768
_,
68-
Template(
69+
Template.After_4_4_0(
70+
_,
71+
Init.After_4_6_0(Type.Name(parentName), _, _) :: Nil,
6972
_,
70-
Init(Type.Name(parentName), _, _) :: Nil,
7173
_,
7274
_
7375
)

core/src/main/scala/higherkindness/mu/rpc/srcgen/avro/rewrites/ReplaceShapelessTaggedDecimal.scala

+27-21
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ class ReplaceShapelessTaggedDecimal extends SyntacticRule("ReplaceShapelessTagge
4545
doc.tree.collect {
4646
// format: off
4747

48-
case t @ Type.Apply(
48+
case t @ Type.Apply.After_4_6_0(
4949
t"@@",
50-
List(
51-
t"scala.math.BigDecimal",
52-
Type.Tuple(
53-
List(
54-
Type.Select(_, precisionNat),
55-
Type.Select(_, scaleNat)
50+
Type.ArgClause(
51+
List(
52+
t"scala.math.BigDecimal",
53+
Type.Tuple(
54+
List(
55+
Type.Select(_, precisionNat),
56+
Type.Select(_, scaleNat)
57+
)
5658
)
5759
)
5860
)
@@ -61,14 +63,16 @@ class ReplaceShapelessTaggedDecimal extends SyntacticRule("ReplaceShapelessTagge
6163
val scale = scaleNat.value.stripPrefix("_").toInt
6264
Patch.replaceTree(t, taggedDecimalType(precision, scale))
6365

64-
case t @ Type.Apply(
66+
case t @ Type.Apply.After_4_6_0(
6567
t"@@",
66-
List(
67-
t"scala.math.BigDecimal",
68-
Type.Tuple(
69-
List(
70-
Type.Tuple(Type.Select(_, precisionNat1) :: Type.Select(_, precisionNat2) :: Nil),
71-
Type.Select(_, scaleNat)
68+
Type.ArgClause(
69+
List(
70+
t"scala.math.BigDecimal",
71+
Type.Tuple(
72+
List(
73+
Type.Tuple(Type.Select(_, precisionNat1) :: Type.Select(_, precisionNat2) :: Nil),
74+
Type.Select(_, scaleNat)
75+
)
7276
)
7377
)
7478
)
@@ -77,14 +81,16 @@ class ReplaceShapelessTaggedDecimal extends SyntacticRule("ReplaceShapelessTagge
7781
val scale = scaleNat.value.stripPrefix("_").toInt
7882
Patch.replaceTree(t, taggedDecimalType(precision, scale))
7983

80-
case t @ Type.Apply(
84+
case t @ Type.Apply.After_4_6_0(
8185
t"@@",
82-
List(
83-
t"scala.math.BigDecimal",
84-
Type.Tuple(
85-
List(
86-
Type.Tuple(Type.Select(_, precisionNat1) :: Type.Select(_, precisionNat2) :: Nil),
87-
Type.Tuple(Type.Select(_, scaleNat1) :: Type.Select(_, scaleNat2) :: Nil)
86+
Type.ArgClause(
87+
List(
88+
t"scala.math.BigDecimal",
89+
Type.Tuple(
90+
List(
91+
Type.Tuple(Type.Select(_, precisionNat1) :: Type.Select(_, precisionNat2) :: Nil),
92+
Type.Tuple(Type.Select(_, scaleNat1) :: Type.Select(_, scaleNat2) :: Nil)
93+
)
8894
)
8995
)
9096
)

core/src/main/scala/higherkindness/mu/rpc/srcgen/service/CompanionObjectGenerator.scala

+14-29
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,7 @@ class CompanionObjectGenerator(
191191
def _bindService[F[_]](
192192
compressionType: _root_.higherkindness.mu.rpc.protocol.CompressionType
193193
)(
194-
$implicitOrUsingCE, ${implicitOrUsing(
195-
param"algebra: $serviceTypeName[F]"
196-
)}
194+
$implicitOrUsingCE, ${param"algebra: $serviceTypeName[F]"}
197195
): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] =
198196
_root_.cats.effect.std.Dispatcher.parallel[F].evalMap { disp =>
199197
_root_.higherkindness.mu.rpc.internal.service.GRPCServiceDefBuilder.build[F](
@@ -211,9 +209,10 @@ class CompanionObjectGenerator(
211209
}
212210

213211
q"""
214-
def bindService[F[_]]($implicitOrUsingCE, ${implicitOrUsing(
215-
param"algebra: $serviceTypeName[F]"
216-
)}): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] =
212+
def bindService[F[_]](
213+
$implicitOrUsingCE,
214+
${param"algebra: $serviceTypeName[F]"}
215+
): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] =
217216
_bindService[F]($compression)
218217
"""
219218
}
@@ -271,10 +270,8 @@ class CompanionObjectGenerator(
271270
compressionType: _root_.higherkindness.mu.rpc.protocol.CompressionType
272271
)(
273272
$implicitOrUsingCE,
274-
${implicitOrUsing(
275-
param"serverContext: _root_.higherkindness.mu.rpc.internal.context.ServerContext[F, Context]"
276-
)},
277-
${implicitOrUsing(param"algebra: $serviceTypeName[$kleisliTypeLambda]")}
273+
${param"serverContext: _root_.higherkindness.mu.rpc.internal.context.ServerContext[F, Context]"},
274+
${param"algebra: $serviceTypeName[$kleisliTypeLambda]"}
278275
): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] =
279276
_root_.cats.effect.std.Dispatcher.parallel[F].evalMap { disp =>
280277
_root_.higherkindness.mu.rpc.internal.service.GRPCServiceDefBuilder.build[F](
@@ -294,10 +291,8 @@ class CompanionObjectGenerator(
294291
q"""
295292
def bindContextService[F[_], Context](
296293
$implicitOrUsingCE,
297-
${implicitOrUsing(
298-
param"serverContext: _root_.higherkindness.mu.rpc.internal.context.ServerContext[F, Context]"
299-
)},
300-
${implicitOrUsing(param"algebra: $serviceTypeName[$kleisliTypeLambda]")}
294+
${param"serverContext: _root_.higherkindness.mu.rpc.internal.context.ServerContext[F, Context]"},
295+
${param"algebra: $serviceTypeName[$kleisliTypeLambda]"}
301296
): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] =
302297
_bindContextService[F, Context]($compression)
303298
"""
@@ -494,9 +489,7 @@ class CompanionObjectGenerator(
494489
options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT
495490
)(
496491
$implicitOrUsingCE,
497-
${implicitOrUsing(
498-
param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"
499-
)}
492+
${param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"}
500493
) extends _root_.io.grpc.stub.AbstractStub[ContextClient[F, Context]](channel, options)
501494
with ($serviceTypeName[$kleisliTypeLambda]) {
502495

@@ -520,9 +513,7 @@ class CompanionObjectGenerator(
520513
options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT
521514
)(
522515
$implicitOrUsingCE,
523-
${implicitOrUsing(
524-
param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"
525-
)}
516+
${param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"}
526517
): _root_.cats.effect.Resource[F, $serviceTypeName[$kleisliTypeLambda]] =
527518
_root_.cats.effect.Resource.make(
528519
new _root_.higherkindness.mu.rpc.channel.ManagedChannelInterpreter[F](channelFor, channelConfigList).build
@@ -540,9 +531,7 @@ class CompanionObjectGenerator(
540531
options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT
541532
)(
542533
$implicitOrUsingCE,
543-
${implicitOrUsing(
544-
param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"
545-
)}
534+
${param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"}
546535
): _root_.cats.effect.Resource[F, $serviceTypeName[$kleisliTypeLambda]] =
547536
_root_.cats.effect.Resource.make(channel)(
548537
(channel) => CE.void(CE.delay(channel.shutdown()))
@@ -560,9 +549,7 @@ class CompanionObjectGenerator(
560549
options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT
561550
)(
562551
$implicitOrUsingCE,
563-
${implicitOrUsing(
564-
param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"
565-
)}
552+
${param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"}
566553
): $serviceTypeName[$kleisliTypeLambda] = {
567554
val managedChannelInterpreter = new _root_.higherkindness.mu.rpc.channel.ManagedChannelInterpreter[F](channelFor, channelConfigList).unsafeBuild(disp)
568555
new ContextClient[F, Context](managedChannelInterpreter, options)
@@ -576,9 +563,7 @@ class CompanionObjectGenerator(
576563
options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT
577564
)(
578565
$implicitOrUsingCE,
579-
${implicitOrUsing(
580-
param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"
581-
)}
566+
${param"clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]"}
582567
): $serviceTypeName[$kleisliTypeLambda] =
583568
new ContextClient[F, Context](channel, options)
584569
"""

0 commit comments

Comments
 (0)