case class ScalafmtConfig(version: String = org.scalafmt.Versions.stable, maxColumn: Int = 80, docstrings: Docstrings = Docstrings(), comments: Comments = Comments(), optIn: OptIn = OptIn(), binPack: BinPack = BinPack(), indent: Indents = Indents(), align: Align = Align(), spaces: Spaces = Spaces(), literals: Literals = Literals(), lineEndings: LineEndings = LineEndings.unix, rewriteTokens: Map[String, String] = Map.empty[String, String], rewrite: RewriteSettings = RewriteSettings.default, indentOperator: IndentOperator = IndentOperator(), newlines: Newlines = Newlines(), runner: ScalafmtRunner = ScalafmtRunner.default, indentYieldKeyword: Boolean = true, importSelectors: ImportSelectors = ImportSelectors.noBinPack, includeCurlyBraceInSelectChains: Boolean = true, includeNoParensInSelectChains: Boolean = false, assumeStandardLibraryStripMargin: Boolean = false, danglingParentheses: DanglingParentheses = DanglingParentheses.default, poorMansTrailingCommasInConfigStyle: Boolean = false, trailingCommas: Option[Style] = None, verticalMultiline: VerticalMultiline = VerticalMultiline(), verticalAlignMultilineOperators: Boolean = false, onTestFailure: String = "", encoding: Codec = "UTF-8", project: ProjectFiles = ProjectFiles(), fileOverride: Obj = Conf.Obj.empty, xmlLiterals: XmlLiterals = XmlLiterals()) extends Product with Serializable

Configuration options for scalafmt.

version

The version of scalafmt to use for this project. Must match the currently running version of scalafmt.

maxColumn

Column limit, any formatting exceeding this field is penalized heavily.

lineEndings

  • If LineEndings.unix, output will include only unix line endings
  • If LineEndings.windows, output will include only windows line endings
  • If LineEndings.preserve, output will include endings included in original file (windows if there was at least one windows line ending, unix if there was zero occurrences of windows line endings)
rewriteTokens

Map of tokens to rewrite. For example, Map("⇒" -> "=>") will rewrite unicode arrows to regular ascii arrows.

indentYieldKeyword

  • If true, indents yield by two spaces
for (i <- j)
  yield banana
  • If false, treats yield like else
for (i <- j)
yield banana
importSelectors

Controls formatting of import selectors with multiple names from the same package

includeCurlyBraceInSelectChains

NB: failure unless newlines.source=classic If true, includes curly brace applications in select chains/pipelines.

// If true
List(1)
  .map { x =>
    x + 2
  }
  .filter(_ > 2)
// If false
List(1).map { x =>
    x + 2
}.filter(_ > 2)
includeNoParensInSelectChains

NB: ignored unless newlines.source=classic If true, includes applications without parens in select chains/pipelines.

// If true
List(1)
  .toIterator
  .buffered
  .map(_ + 2)
  .filter(_ > 2)
// If false
List(1).toIterator.buffered
  .map(_ + 2)
  .filter(_ > 2)
assumeStandardLibraryStripMargin

If true, the margin character | is treated as the new indentation in multiline strings ending with .stripMargin.

danglingParentheses

If true AND @binPackArguments is true AND @configStyleArguments is false, then this

function(
    longerArg1,
    longerArg3)

is formatted like this

function(
    longerArg1,
    longerArg3
)
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScalafmtConfig
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScalafmtConfig(version: String = org.scalafmt.Versions.stable, maxColumn: Int = 80, docstrings: Docstrings = Docstrings(), comments: Comments = Comments(), optIn: OptIn = OptIn(), binPack: BinPack = BinPack(), indent: Indents = Indents(), align: Align = Align(), spaces: Spaces = Spaces(), literals: Literals = Literals(), lineEndings: LineEndings = LineEndings.unix, rewriteTokens: Map[String, String] = Map.empty[String, String], rewrite: RewriteSettings = RewriteSettings.default, indentOperator: IndentOperator = IndentOperator(), newlines: Newlines = Newlines(), runner: ScalafmtRunner = ScalafmtRunner.default, indentYieldKeyword: Boolean = true, importSelectors: ImportSelectors = ImportSelectors.noBinPack, includeCurlyBraceInSelectChains: Boolean = true, includeNoParensInSelectChains: Boolean = false, assumeStandardLibraryStripMargin: Boolean = false, danglingParentheses: DanglingParentheses = DanglingParentheses.default, poorMansTrailingCommasInConfigStyle: Boolean = false, trailingCommas: Option[Style] = None, verticalMultiline: VerticalMultiline = VerticalMultiline(), verticalAlignMultilineOperators: Boolean = false, onTestFailure: String = "", encoding: Codec = "UTF-8", project: ProjectFiles = ProjectFiles(), fileOverride: Obj = Conf.Obj.empty, xmlLiterals: XmlLiterals = XmlLiterals())

    version

    The version of scalafmt to use for this project. Must match the currently running version of scalafmt.

    maxColumn

    Column limit, any formatting exceeding this field is penalized heavily.

    lineEndings

    • If LineEndings.unix, output will include only unix line endings
    • If LineEndings.windows, output will include only windows line endings
    • If LineEndings.preserve, output will include endings included in original file (windows if there was at least one windows line ending, unix if there was zero occurrences of windows line endings)
    rewriteTokens

    Map of tokens to rewrite. For example, Map("⇒" -> "=>") will rewrite unicode arrows to regular ascii arrows.

    indentYieldKeyword

    • If true, indents yield by two spaces
    for (i <- j)
      yield banana
    • If false, treats yield like else
    for (i <- j)
    yield banana
    importSelectors

    Controls formatting of import selectors with multiple names from the same package

    includeCurlyBraceInSelectChains

    NB: failure unless newlines.source=classic If true, includes curly brace applications in select chains/pipelines.

    // If true
    List(1)
      .map { x =>
        x + 2
      }
      .filter(_ > 2)
    // If false
    List(1).map { x =>
        x + 2
    }.filter(_ > 2)
    includeNoParensInSelectChains

    NB: ignored unless newlines.source=classic If true, includes applications without parens in select chains/pipelines.

    // If true
    List(1)
      .toIterator
      .buffered
      .map(_ + 2)
      .filter(_ > 2)
    // If false
    List(1).toIterator.buffered
      .map(_ + 2)
      .filter(_ > 2)
    assumeStandardLibraryStripMargin

    If true, the margin character | is treated as the new indentation in multiline strings ending with .stripMargin.

    danglingParentheses

    If true AND @binPackArguments is true AND @configStyleArguments is false, then this

    function(
        longerArg1,
        longerArg3)

    is formatted like this

    function(
        longerArg1,
        longerArg3
    )

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val align: Align
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val assumeStandardLibraryStripMargin: Boolean
  7. val binPack: BinPack
  8. def breakAfterInfix(tree: ⇒ Tree): AfterInfix
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  10. val comments: Comments
  11. val danglingParentheses: DanglingParentheses
  12. val docstrings: Docstrings
  13. val encoding: Codec
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. val fileOverride: Obj
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def forSbt: ScalafmtConfig
  18. lazy val forceNewlineBeforeDocstring: Boolean
  19. def formatInfix(tree: ⇒ Tree): Boolean
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def getConfigFor(filename: String): Try[ScalafmtConfig]
  22. def hasRewrites: Boolean
  23. val importSelectors: ImportSelectors
  24. val includeCurlyBraceInSelectChains: Boolean
  25. val includeNoParensInSelectChains: Boolean
  26. val indent: Indents
  27. val indentOperator: IndentOperator
  28. val indentYieldKeyword: Boolean
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. val lineEndings: LineEndings
  31. val literals: Literals
  32. val maxColumn: Int
  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. val newlines: Newlines
  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. val onTestFailure: String
  38. val optIn: OptIn
  39. val poorMansTrailingCommasInConfigStyle: Boolean
  40. val project: ProjectFiles
  41. val rewrite: RewriteSettings
  42. val rewriteTokens: Map[String, String]
  43. val runner: ScalafmtRunner
  44. val spaces: Spaces
  45. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  46. val version: String
  47. val verticalAlignMultilineOperators: Boolean
  48. val verticalMultiline: VerticalMultiline
  49. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  52. def withDialect(dialect: Dialect): ScalafmtConfig
  53. def withDialect(dialect: Dialect, name: String): ScalafmtConfig
  54. def withoutRewrites: ScalafmtConfig
  55. val xmlLiterals: XmlLiterals

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped