Class/Object

org.scalafmt.config

ScalafmtConfig

Related Docs: object ScalafmtConfig | package config

Permalink

case class ScalafmtConfig(version: String = org.scalafmt.Versions.stable, maxColumn: Int = 80, docstrings: Docstrings = Docstrings(), comments: Comments = Comments(), optIn: OptIn = OptIn(), binPack: BinPack = BinPack(), continuationIndent: ContinuationIndent = ContinuationIndent(), align: Align = Align(), spaces: Spaces = Spaces(), literals: Literals = Literals(), lineEndings: LineEndings = LineEndings.unix, rewriteTokens: Map[String, String] = Map.empty[String, String], rewrite: RewriteSettings = RewriteSettings(), indentOperator: IndentOperator = IndentOperator(), newlines: Newlines = Newlines(), runner: ScalafmtRunner = ScalafmtRunner.default, indentYieldKeyword: Boolean = true, importSelectors: ImportSelectors = ImportSelectors.noBinPack, unindentTopLevelOperators: Boolean = false, includeCurlyBraceInSelectChains: Boolean = true, includeNoParensInSelectChains: Boolean = false, assumeStandardLibraryStripMargin: Boolean = false, danglingParentheses: DanglingParentheses = DanglingParentheses(true, true), poorMansTrailingCommasInConfigStyle: Boolean = false, trailingCommas: TrailingCommas = TrailingCommas.never, 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. Currently not used, the plan is to use this field for the IntelliJ+sbt integrations.

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; If org.scalafmt.config.ImportSelectors.binPack, import selectors are arranged to fit within the maximum line width If org.scalafmt.config.ImportSelectors.noBinPack, import selectors are broken to one per line If org.scalafmt.config.ImportSelectors.singleLine, import selectors are kept on a single line The default setting is currently noBinPack.

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 )

trailingCommas

If org.scalafmt.config.TrailingCommas.always, trailing commas are added everywhere a newline is followed by a right parens, brace or bracket. If org.scalafmt.config.TrailingCommas.never, trailing commas are removed whenever they appear. If org.scalafmt.config.TrailingCommas.preserve, existing trailing commas will be preserved, and no new ones will be added.

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(), continuationIndent: ContinuationIndent = ContinuationIndent(), align: Align = Align(), spaces: Spaces = Spaces(), literals: Literals = Literals(), lineEndings: LineEndings = LineEndings.unix, rewriteTokens: Map[String, String] = Map.empty[String, String], rewrite: RewriteSettings = RewriteSettings(), indentOperator: IndentOperator = IndentOperator(), newlines: Newlines = Newlines(), runner: ScalafmtRunner = ScalafmtRunner.default, indentYieldKeyword: Boolean = true, importSelectors: ImportSelectors = ImportSelectors.noBinPack, unindentTopLevelOperators: Boolean = false, includeCurlyBraceInSelectChains: Boolean = true, includeNoParensInSelectChains: Boolean = false, assumeStandardLibraryStripMargin: Boolean = false, danglingParentheses: DanglingParentheses = DanglingParentheses(true, true), poorMansTrailingCommasInConfigStyle: Boolean = false, trailingCommas: TrailingCommas = TrailingCommas.never, verticalMultiline: VerticalMultiline = VerticalMultiline(), verticalAlignMultilineOperators: Boolean = false, onTestFailure: String = "", encoding: Codec = "UTF-8", project: ProjectFiles = ProjectFiles(), fileOverride: Obj = Conf.Obj.empty, xmlLiterals: XmlLiterals = XmlLiterals())

    Permalink

    version

    The version of scalafmt to use for this project. Currently not used, the plan is to use this field for the IntelliJ+sbt integrations.

    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; If org.scalafmt.config.ImportSelectors.binPack, import selectors are arranged to fit within the maximum line width If org.scalafmt.config.ImportSelectors.noBinPack, import selectors are broken to one per line If org.scalafmt.config.ImportSelectors.singleLine, import selectors are kept on a single line The default setting is currently noBinPack.

    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 )

    trailingCommas

    If org.scalafmt.config.TrailingCommas.always, trailing commas are added everywhere a newline is followed by a right parens, brace or bracket. If org.scalafmt.config.TrailingCommas.never, trailing commas are removed whenever they appear. If org.scalafmt.config.TrailingCommas.preserve, existing trailing commas will be preserved, and no new ones will be added.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val align: Align

    Permalink
  5. lazy val alignMap: Map[String, java.util.regex.Pattern]

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. val assumeStandardLibraryStripMargin: Boolean

    Permalink

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

  8. val binPack: BinPack

    Permalink
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val comments: Comments

    Permalink
  11. val continuationIndent: ContinuationIndent

    Permalink
  12. val danglingParentheses: DanglingParentheses

    Permalink

    If true AND @binPackArguments is true AND @configStyleArguments is false, then this function( longerArg1, longerArg3) is formatted like this function( longerArg1, longerArg3 )

  13. implicit final lazy val decoder: ConfDecoder[ScalafmtConfig]

    Permalink
  14. val docstrings: Docstrings

    Permalink
  15. lazy val encloseSelectChains: Boolean

    Permalink
  16. val encoding: Codec

    Permalink
  17. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. val fileOverride: Obj

    Permalink
  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def forSbt: ScalafmtConfig

    Permalink
  21. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  22. def getConfigFor(filename: String): ScalafmtConfig

    Permalink
  23. val importSelectors: ImportSelectors

    Permalink

    Controls formatting of import selectors with multiple names from the same package; If org.scalafmt.config.ImportSelectors.binPack, import selectors are arranged to fit within the maximum line width If org.scalafmt.config.ImportSelectors.noBinPack, import selectors are broken to one per line If org.scalafmt.config.ImportSelectors.singleLine, import selectors are kept on a single line The default setting is currently noBinPack.

  24. val includeCurlyBraceInSelectChains: Boolean

    Permalink

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

    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)
  25. val includeNoParensInSelectChains: Boolean

    Permalink

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

    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)
  26. val indentOperator: IndentOperator

    Permalink
  27. def indentOperatorTopLevelOnly: Boolean

    Permalink
  28. val indentYieldKeyword: Boolean

    Permalink

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

  29. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  30. val lineEndings: LineEndings

    Permalink

    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)

  31. val literals: Literals

    Permalink
  32. val maxColumn: Int

    Permalink

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

  33. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  34. val newlines: Newlines

    Permalink
  35. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. val onTestFailure: String

    Permalink
  38. val optIn: OptIn

    Permalink
  39. val poorMansTrailingCommasInConfigStyle: Boolean

    Permalink
  40. val project: ProjectFiles

    Permalink
  41. val rewrite: RewriteSettings

    Permalink
  42. val rewriteTokens: Map[String, String]

    Permalink

    Map of tokens to rewrite.

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

  43. val runner: ScalafmtRunner

    Permalink
  44. val spaces: Spaces

    Permalink
  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  46. val trailingCommas: TrailingCommas

    Permalink

    If org.scalafmt.config.TrailingCommas.always, trailing commas are added everywhere a newline is followed by a right parens, brace or bracket.

    If org.scalafmt.config.TrailingCommas.always, trailing commas are added everywhere a newline is followed by a right parens, brace or bracket. If org.scalafmt.config.TrailingCommas.never, trailing commas are removed whenever they appear. If org.scalafmt.config.TrailingCommas.preserve, existing trailing commas will be preserved, and no new ones will be added.

  47. val version: String

    Permalink

    The version of scalafmt to use for this project.

    The version of scalafmt to use for this project. Currently not used, the plan is to use this field for the IntelliJ+sbt integrations.

  48. val verticalAlignMultilineOperators: Boolean

    Permalink
  49. val verticalMultiline: VerticalMultiline

    Permalink
  50. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. def withDialect(dialect: Dialect): ScalafmtConfig

    Permalink
  54. val xmlLiterals: XmlLiterals

    Permalink

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped