Skip to content

Commit

Permalink
Merge pull request #114 from ie3-institute/to/#113-windows-comaptibility
Browse files Browse the repository at this point in the history
To/#113 windows comaptibility
  • Loading branch information
t-ober authored Sep 8, 2021
2 parents 48dfd9b + f58f261 commit e8569c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

# use LF line endings within the project
* text eol=lf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ package edu.ie3.powerFactory2psdm.util

import java.nio.file.{Files, Paths}
import org.scalafmt.interfaces.Scalafmt
import java.io.File

object Formatter {

def format(str: String, fmtPath: Option[String]): String = {
val classLoader = this.getClass.getClassLoader
val scalafmt = Scalafmt.create(classLoader)
val configFile = new File(classLoader.getResource(".scalafmt.conf").getFile)
val defaultConfigPath =
Paths.get(classLoader.getResource(".scalafmt.conf").getPath)
Paths.get(configFile.getPath)
val defaultConfig =
if (Files.exists(defaultConfigPath)) defaultConfigPath else Paths.get("")
val config = fmtPath.fold(defaultConfig)(Paths.get(_))
Expand Down

0 comments on commit e8569c5

Please sign in to comment.