Using Dixtra as a library

dixtra-core is the formatter alone, with no dependency other than scalameta:

libraryDependencies += "com.colofabrix.scala" %% "dixtra-core" % "1.0.0-RC1"
import com.colofabrix.scala.dixtra.{ Config, Dixtra, SourceDialect }

Dixtra.format(source)                                       // the default configuration
Dixtra.format(source, Config.default.copy(maxColumn = 100))
Dixtra.format(source, Config.default, SourceDialect.sbt)    // an sbt 2 build file

Dixtra.format is a pure function from text to text. It returns Right(formatted), or Left of a FormatError:

Embedded.run in dixtra-cli runs the command line without exiting the JVM, with Java types only: it hands each report line to a callback, one for the standard output and one for the standard error, and returns the exit code, 2 for invalid options. The sbt plugin calls it from its own class loader.

The API is documented in the API documentation.