Skip to content

Commit

Permalink
Scalafmt and Scalafix
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Sep 10, 2024
1 parent 9bf1caf commit c9b63ce
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object PlatformIO {

type Path = java.nio.file.Path
object Path {
def workingDirectory = Paths.get(sys.props("user.dir"))
def workingDirectory: Path = Paths.get(sys.props("user.dir"))
}
object Paths {
def get(path: String): Path = java.nio.file.Paths.get(path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object PlatformIO {

type Path = java.nio.file.Path
object Path {
def workingDirectory = Paths.get(sys.props("user.dir"))
def workingDirectory: Path = Paths.get(sys.props("user.dir"))
}
object Paths {
def get(path: String): Path = java.nio.file.Paths.get(path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ object MacroCompatScala2 {

def locationImpl(c: Context): c.Tree = {
import c.universe._
val workingDirectory: String = sys.props("user.dir") + java.io.File.separator
val workingDirectory: String =
sys.props("user.dir") + java.io.File.separator
val line = Literal(Constant(c.enclosingPosition.line))
val path0 = c.enclosingPosition.source.path
val relativePath =
if (path0.startsWith(workingDirectory)) path0.drop(workingDirectory.length)
if (path0.startsWith(workingDirectory))
path0.drop(workingDirectory.length)
else path0
val path = Literal(Constant(relativePath))
New(c.mirror.staticClass(classOf[Location].getName()), path, line)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class Lines extends Serializable {
val p = Paths.get(cwd).resolve(path)
if (Files.exists(p)) p
else if (max < 1) sys.error(s"$path was not found")
else if (cwd.contains("\\")) findPath(cwd.split("\\").dropRight(1).mkString("\\"), path, max - 1)
else if (cwd.contains("\\"))
findPath(cwd.split("\\").dropRight(1).mkString("\\"), path, max - 1)
else findPath(cwd.split("/").dropRight(1).mkString("/"), path, max - 1)
}

Expand Down

0 comments on commit c9b63ce

Please sign in to comment.