Skip to content

Commit 7fdd212

Browse files
committed
update scalafmt setting
1 parent 20daf76 commit 7fdd212

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

.scalafmt.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ style = defaultWithAlign
33
maxColumn = 100
44
assumeStandardLibraryStripMargin = true
55
runner.dialect = "scala213source3"
6+
rewrite.scala3.convertToNewSyntax = true
7+
rewrite.scala3.newSyntax.control = false

src/main/scala/sbtprotoc/FilteringClassLoader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ final class FilteringClassLoader(parent: ClassLoader, extraParentPrefixes: Seq[S
99
"jdk.internal.reflect."
1010
) ++ extraParentPrefixes
1111

12-
override def loadClass(name: String, resolve: Boolean): Class[_] = {
12+
override def loadClass(name: String, resolve: Boolean): Class[?] = {
1313
if (parentPrefixes.exists(name.startsWith _)) {
1414
super.loadClass(name, resolve)
1515
} else {

src/main/scala/sbtprotoc/ProtocPlugin.scala

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package sbtprotoc
22

3-
import sbt._
4-
import Keys._
3+
import sbt.*
4+
import Keys.*
55
import java.io.{File, FileInputStream, IOException}
66

77
import protocbridge.{DescriptorSetGenerator, SandboxedJvmGenerator, Target, ProtocRunner}
@@ -14,8 +14,8 @@ import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport.platformD
1414
import java.net.URLClassLoader
1515
import java.util.jar.JarInputStream
1616
import sbt.librarymanagement.DependencyResolution
17-
import protocbridge.{Artifact => BridgeArtifact}
18-
import protocbridge.{SystemDetector => BridgeSystemDetector, FileCache, PluginGenerator}
17+
import protocbridge.Artifact as BridgeArtifact
18+
import protocbridge.{SystemDetector as BridgeSystemDetector, FileCache, PluginGenerator}
1919
import scala.concurrent.{Future, blocking}
2020
import scala.concurrent.ExecutionContext.Implicits.global
2121

@@ -169,9 +169,9 @@ object ProtocPlugin extends AutoPlugin {
169169

170170
override def projectConfigurations: Seq[Configuration] = Seq(ProtobufConfig)
171171

172-
override def globalSettings: Seq[Def.Setting[_]] = protobufGlobalSettings
172+
override def globalSettings: Seq[Def.Setting[?]] = protobufGlobalSettings
173173

174-
private[this] def protobufGlobalSettings: Seq[Def.Setting[_]] =
174+
private[this] def protobufGlobalSettings: Seq[Def.Setting[?]] =
175175
Seq(
176176
PB.protocVersion := "3.21.7",
177177
PB.deleteTargetDirectory := true,
@@ -196,7 +196,7 @@ object ProtocPlugin extends AutoPlugin {
196196
"instead of relying on the default."
197197
)
198198

199-
import sbt.librarymanagement.ivy._
199+
import sbt.librarymanagement.ivy.*
200200
val ivyConfig = InlineIvyConfiguration()
201201
.withResolvers(Vector(Resolver.defaultLocal, Resolver.mavenCentral))
202202
.withLog(log)
@@ -238,11 +238,11 @@ object ProtocPlugin extends AutoPlugin {
238238
)
239239
)
240240

241-
override def projectSettings: Seq[Def.Setting[_]] =
241+
override def projectSettings: Seq[Def.Setting[?]] =
242242
Seq(Compile, Test).flatMap(inConfig(_)(protobufConfigSettings)) ++
243243
protobufProjectSettings
244244

245-
private[this] val protobufProjectSettings: Seq[Def.Setting[_]] =
245+
private[this] val protobufProjectSettings: Seq[Def.Setting[?]] =
246246
Seq(
247247
PB.externalIncludePath := target.value / "protobuf_external",
248248
PB.externalSourcePath := target.value / "protobuf_external_src",
@@ -303,7 +303,7 @@ object ProtocPlugin extends AutoPlugin {
303303
)
304304

305305
// Settings that are applied at configuration (Compile, Test) scope.
306-
val protobufConfigSettings: Seq[Setting[_]] =
306+
val protobufConfigSettings: Seq[Setting[?]] =
307307
Seq(
308308
PB.recompile := false,
309309
PB.protocOptions := Nil,
@@ -542,7 +542,7 @@ object ProtocPlugin extends AutoPlugin {
542542
(FilesInfo[ModifiedFileInfo], URLClassLoader)
543543
]
544544

545-
private[this] def schemasTask(key: TaskKey[_]): Def.Initialize[Task[Set[File]]] = Def.task {
545+
private[this] def schemasTask(key: TaskKey[?]): Def.Initialize[Task[Set[File]]] = Def.task {
546546
val toInclude = (key / includeFilter).value
547547
val toExclude = (key / excludeFilter).value
548548
val processManifests = (key / PB.manifestProcessing).value
@@ -566,7 +566,7 @@ object ProtocPlugin extends AutoPlugin {
566566
}
567567
}
568568

569-
private[this] def sourceGeneratorTask(key: TaskKey[_]): Def.Initialize[Task[Seq[File]]] =
569+
private[this] def sourceGeneratorTask(key: TaskKey[?]): Def.Initialize[Task[Seq[File]]] =
570570
Def.task {
571571
val log = (key / streams).value.log
572572
val resolver = (key / PB.artifactResolver).value
@@ -681,7 +681,7 @@ object ProtocPlugin extends AutoPlugin {
681681
)
682682
}
683683

684-
import CacheImplicits._
684+
import CacheImplicits.*
685685
type Stamp = (Arguments, Seq[FilesInfo[ModifiedFileInfo]])
686686
val cachedCompile = Tracked.inputChanged[Stamp, Set[File]](
687687
cacheFile / "input"

0 commit comments

Comments
 (0)