Skip to content

Commit 73a34dc

Browse files
committed
Run scalafmt (#638)
1 parent 713670f commit 73a34dc

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/GlobWalker.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import scala.util.Try
99
object GlobWalker {
1010

1111
/**
12-
* Traverses the base directory and returns all files that match a given glob.
13-
*
14-
* Only returns files, not directories. If a directory matches a glob then all its descendents are included.
15-
*
16-
* @see the glob syntax in [[java.nio.file.FileSystem#getPathMatcher]]
17-
*/
12+
* Traverses the base directory and returns all files that match a given glob.
13+
*
14+
* Only returns files, not directories. If a directory matches a glob then all its descendents are included.
15+
*
16+
* @see the glob syntax in [[java.nio.file.FileSystem#getPathMatcher]]
17+
*/
1818
def walkFiles(baseDirectory: os.Path, globs: IArray[String]): IndexedSeq[os.Path] = {
1919
val pathOrMatchers = globs.map { glob =>
2020
Try(FileSystems.getDefault.getPathMatcher(s"glob:$glob")).toOption.toRight(baseDirectory / glob)
@@ -30,15 +30,14 @@ object GlobWalker {
3030

3131
val builder = IndexedSeq.newBuilder[os.Path]
3232

33-
def processDirectoryAndSkip(dir: os.Path): Boolean = {
33+
def processDirectoryAndSkip(dir: os.Path): Boolean =
3434
if (matches(dir)) {
3535
os.walk.stream(dir).generate { path =>
3636
if (path.toIO.isFile) builder += path
3737
Generator.Continue
3838
}
3939
true
4040
} else false
41-
}
4241

4342
os.walk.stream(baseDirectory, processDirectoryAndSkip).generate { path =>
4443
if (path.toIO.isFile && matches(path)) builder += path

importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/LibTsSource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ object LibTsSource {
5050

5151
def fromFilesGlobEntry(fromFolder: LibTsSource.FromFolder, globs: Option[IArray[String]]): IArray[InFile] = {
5252
val baseDirectory = fromFolder.folder.path
53-
val files = globs.fold(os.walk(baseDirectory))(GlobWalker.walkFiles(baseDirectory, _)).map(InFile(_))
53+
val files = globs.fold(os.walk(baseDirectory))(GlobWalker.walkFiles(baseDirectory, _)).map(InFile(_))
5454
IArray.fromTraversable(files)
5555
}
5656

importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase1ReadTypescript.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Phase1ReadTypescript(
5757
f.shortenedFiles
5858
case f: LibTsSource.FromFolder =>
5959
/* There are often whole trees parallel to what is specified in `typings` (or similar). This ignores some of them. */
60-
val bound = f.shortenedFiles.map(_.folder).distinct
60+
val bound = f.shortenedFiles.map(_.folder).distinct
6161
val boundOrParent = if (bound.isEmpty) IArray(f.folder) else bound
6262
boundOrParent.flatMap(PathsFromTsLibSource.filesFrom).distinct
6363
}

0 commit comments

Comments
 (0)