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
likeelse
for (i <- j) yield banana
- If true, indents
- 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 )
- Alphabetic
- By Inheritance
- ScalafmtConfig
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
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
likeelse
for (i <- j) yield banana
- If true, indents
- 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 )
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val align: Align
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val assumeStandardLibraryStripMargin: Boolean
- val binPack: BinPack
- def breakAfterInfix(tree: ⇒ Tree): AfterInfix
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val comments: Comments
- val danglingParentheses: DanglingParentheses
- val docstrings: Docstrings
- val encoding: Codec
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val fileOverride: Obj
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def forSbt: ScalafmtConfig
- lazy val forceNewlineBeforeDocstring: Boolean
- def formatInfix(tree: ⇒ Tree): Boolean
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getConfigFor(filename: String): Try[ScalafmtConfig]
- def hasRewrites: Boolean
- val importSelectors: ImportSelectors
- val includeCurlyBraceInSelectChains: Boolean
- val includeNoParensInSelectChains: Boolean
- val indent: Indents
- val indentOperator: IndentOperator
- val indentYieldKeyword: Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val lineEndings: LineEndings
- val literals: Literals
- val maxColumn: Int
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val newlines: Newlines
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val onTestFailure: String
- val optIn: OptIn
- val poorMansTrailingCommasInConfigStyle: Boolean
- val project: ProjectFiles
- val rewrite: RewriteSettings
- val rewriteTokens: Map[String, String]
- val runner: ScalafmtRunner
- val spaces: Spaces
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val version: String
- val verticalAlignMultilineOperators: Boolean
- val verticalMultiline: VerticalMultiline
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def withDialect(dialect: Dialect): ScalafmtConfig
- def withDialect(dialect: Dialect, name: String): ScalafmtConfig
- def withoutRewrites: ScalafmtConfig
- val xmlLiterals: XmlLiterals