Skip to content

Commit 5365a21

Browse files
authored
Merge pull request #444 from xuwei-k/vararg-splice
update scalafmt setting. use new vararg splice syntax
2 parents 514d9da + c5eb2dd commit 5365a21

File tree

14 files changed

+31
-32
lines changed

14 files changed

+31
-32
lines changed

.scalafmt.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ rewrite.scala3.convertToNewSyntax = true
2727
runner.dialectOverride.allowSignificantIndentation = false
2828
runner.dialectOverride.allowAsForImportRename = false
2929
runner.dialectOverride.allowStarWildcardImport = false
30-
runner.dialectOverride.allowPostfixStarVarargSplices = false

io/src/main/scala/sbt/internal/io/MacOSXWatchService.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ private[sbt] class MacOSXWatchService extends WatchService with Unregisterable {
9494
}
9595
)
9696
) {
97-
parentKeys.put(parent, underlying.register(parent, events: _*))
97+
parentKeys.put(parent, underlying.register(parent, events*))
9898
}
9999
}
100100
val key =
101101
parentKeys.remove(resolved) match {
102102
case Some(k) => k
103103
case _ =>
104-
underlying.register(resolved, events: _*)
104+
underlying.register(resolved, events*)
105105
}
106106
keys.put(resolved, key)
107107
key

io/src/main/scala/sbt/internal/io/Retry.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ private[sbt] object Retry {
2727
* the excludedExceptions list.
2828
*/
2929
private[sbt] def apply[@specialized T](f: => T, excludedExceptions: Class[? <: Throwable]*): T =
30-
apply(f, limit, excludedExceptions: _*)
30+
apply(f, limit, excludedExceptions*)
3131

3232
/**
3333
* Retry on all non-fatal exceptions that are NOT listed in
@@ -37,7 +37,7 @@ private[sbt] object Retry {
3737
f: => T,
3838
limit: Int,
3939
excludedExceptions: Class[? <: Throwable]*,
40-
): T = apply(f, limit, defaultSleepInMillis, excludedExceptions: _*)
40+
): T = apply(f, limit, defaultSleepInMillis, excludedExceptions*)
4141

4242
/**
4343
* Retry on all non-fatal exceptions that are NOT listed in
@@ -64,7 +64,7 @@ private[sbt] object Retry {
6464
* Non-IOException will immediately throw.
6565
*/
6666
private[sbt] def io[@specialized A1](f: => A1, excludedExceptions: Class[? <: IOException]*): A1 =
67-
io(f, limit, excludedExceptions: _*)
67+
io(f, limit, excludedExceptions*)
6868

6969
/**
7070
* Retry on all IOExceptions that are NOT listed in
@@ -75,7 +75,7 @@ private[sbt] object Retry {
7575
f: => A1,
7676
limit: Int,
7777
excludedExceptions: Class[? <: IOException]*,
78-
): A1 = io(f, limit, defaultSleepInMillis, excludedExceptions: _*)
78+
): A1 = io(f, limit, defaultSleepInMillis, excludedExceptions*)
7979

8080
/**
8181
* Retry on all IOExceptions that are NOT listed in

io/src/main/scala/sbt/internal/io/SourceModificationWatch.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private[sbt] final class WatchState private (
124124
}
125125

126126
/** register a path with the watch service */
127-
private[sbt] def register(path: Path): WatchKey = service.register(path, WatchState.events: _*)
127+
private[sbt] def register(path: Path): WatchKey = service.register(path, WatchState.events*)
128128

129129
/** A new state, with a new `count`. */
130130
private[sbt] def withCount(count: Int): WatchState =
@@ -161,7 +161,7 @@ private[sbt] class NewWatchState(
161161
registered.get(path) match {
162162
case Some(k) => k
163163
case None =>
164-
val key = service.register(path, WatchState.events: _*)
164+
val key = service.register(path, WatchState.events*)
165165
registered.put(path, key).foreach { k =>
166166
k.reset()
167167
k.cancel()

io/src/main/scala/sbt/internal/nio/PollingWatchService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private[sbt] class PollingWatchService(delay: FiniteDuration, timeSource: TimeSo
9898
registered.get(path) match {
9999
case Some(k) => k
100100
case None =>
101-
val newKey = new PollingWatchKey(path, events: _*)
101+
val newKey = new PollingWatchKey(path, events*)
102102
registered.put(path, newKey)
103103
pollQueue.add(newKey)
104104
newKey

io/src/main/scala/sbt/internal/nio/SwovalConverters.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private[sbt] object SwovalFileTreeView extends FileTreeView.Nio[FileAttributes]
5555
}
5656
result.result()
5757
},
58-
excludedExceptions: _*
58+
excludedExceptions*
5959
)
6060

6161
private val excludedExceptions =

io/src/main/scala/sbt/io/IO.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ object IO {
14331433
*/
14341434
def getModifiedTimeOrZero(file: File): Long =
14351435
try {
1436-
Retry(Milli.getModifiedTime(file), excludeFileNotFound: _*)
1436+
Retry(Milli.getModifiedTime(file), excludeFileNotFound*)
14371437
} catch {
14381438
case _: FileNotFoundException =>
14391439
val unnormalized = file.toPath
@@ -1458,7 +1458,7 @@ object IO {
14581458
*/
14591459
def setModifiedTimeOrFalse(file: File, mtime: Long): Boolean =
14601460
try {
1461-
Retry(Milli.setModifiedTime(file, mtime), excludeFileNotFound: _*)
1461+
Retry(Milli.setModifiedTime(file, mtime), excludeFileNotFound*)
14621462
true
14631463
} catch {
14641464
case _: FileNotFoundException =>

io/src/main/scala/sbt/io/Path.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ sealed trait RichNioPath extends Any {
111111
* This operation requires underlying filesystem to support `IO.isPosix`.
112112
*/
113113
def permissions: Set[PosixFilePermission] =
114-
Files.getPosixFilePermissions(asPath, linkOptions: _*).asScala.toSet
114+
Files.getPosixFilePermissions(asPath, linkOptions*).asScala.toSet
115115

116116
/**
117117
* Returns this file's POSIX permissions.
@@ -222,23 +222,23 @@ sealed trait RichNioPath extends Any {
222222
testPermission(PosixFilePermission.OTHERS_EXECUTE)
223223

224224
def attributes: BasicFileAttributes =
225-
Files.readAttributes(asPath, classOf[BasicFileAttributes], linkOptions: _*)
225+
Files.readAttributes(asPath, classOf[BasicFileAttributes], linkOptions*)
226226

227227
def posixAttributes: PosixFileAttributes =
228-
Files.readAttributes(asPath, classOf[PosixFileAttributes], linkOptions: _*)
228+
Files.readAttributes(asPath, classOf[PosixFileAttributes], linkOptions*)
229229

230230
def dosAttributes: DosFileAttributes =
231-
Files.readAttributes(asPath, classOf[DosFileAttributes], linkOptions: _*)
231+
Files.readAttributes(asPath, classOf[DosFileAttributes], linkOptions*)
232232

233233
def aclFileAttributeView: AclFileAttributeView =
234-
Files.getFileAttributeView(asPath, classOf[AclFileAttributeView], linkOptions: _*)
234+
Files.getFileAttributeView(asPath, classOf[AclFileAttributeView], linkOptions*)
235235

236236
/**
237237
* Returns the owner of a file.
238238
* This operation requires underlying filesystem to support `IO.hasFileOwnerAttributeView`.
239239
*/
240240
def owner: UserPrincipal =
241-
Files.getOwner(asPath, linkOptions: _*)
241+
Files.getOwner(asPath, linkOptions*)
242242

243243
/**
244244
* Returns the owner of a file.

io/src/main/scala/sbt/io/WatchService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ object WatchService {
7070
registered.synchronized {
7171
registered.get(path) match {
7272
case None =>
73-
val key = path.register(service, events: _*)
73+
val key = path.register(service, events*)
7474
registered += path -> key
7575
key
7676
case Some(key) =>

io/src/main/scala/sbt/nio/file/FileTreeView.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ object FileTreeView {
6464
try stream.iterator.asScala.flatMap(p => FileAttributes(p).toOption.map(p -> _)).toVector
6565
finally stream.close()
6666
},
67-
excludedExceptions: _*
67+
excludedExceptions*
6868
)
6969
}
7070

0 commit comments

Comments
 (0)