Skip to content

Commit

Permalink
Merge pull request #1212 from olafurpg/1206
Browse files Browse the repository at this point in the history
Re-add fromHoconString overload to please neo-scalafmt
  • Loading branch information
olafurpg authored Jun 5, 2018
2 parents 0758cdb + 113d2f8 commit 251d601
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import metaconfig.Configured
import metaconfig.Configured.Ok
import org.scalafmt.config.PlatformConfig._

// NOTE: these methods are intended for internal usage and are subject to
// binary and source breaking changes between any release. For a stable API
// use org.scalafmt.Scalafmt. Documentation on using scalafmt as a library
// can be seen here https://scalameta.org/scalafmt/#Standalonelibrary
object Config {

def fromInput(input: Input, path: Option[String]): Configured[Conf] = {
Expand All @@ -19,10 +23,18 @@ object Config {
}
}

def fromHoconString(string: String): Configured[ScalafmtConfig] =
fromHoconString(string, None)

def fromHoconString(
string: String,
path: Option[String] = None,
default: ScalafmtConfig = ScalafmtConfig.default
path: Option[String]): Configured[ScalafmtConfig] =
fromHoconString(string, path, ScalafmtConfig.default)

def fromHoconString(
string: String,
path: Option[String],
default: ScalafmtConfig
): Configured[ScalafmtConfig] =
fromConf(fromInput(Input.String(string), path), default = default)

Expand Down

0 comments on commit 251d601

Please sign in to comment.