Controls how line breaks in the input source are handled
If classic
(default), the old mixed behaviour will be used
If keep
, try to keep source newlines
If fold
, ignore source and try to remove line breaks
If unfold
, ignore source and try to break lines
If true, a newline will never be placed in front of js.native.
If true, scalafmt may choose to put a newline before colon : at defs.
If true, adds a penalty to newlines before a dot starting a select chain of length one and argument list. The penalty matches the number of arguments to the select chain application.
// If true, favor logger.elem(a, b, c) // instead of logger .elem(a, b, c) // penalty is proportional to argument count, example: logger.elem(a, b, c) // penalty 2 logger.elem(a, b, c, d) // penalty 3, etc.
If false, matches pre-v0.5 behavior. Note. this option may be removed in a future release.
If true, puts a newline after the open brace and the parameters list of an anonymous function. For example something.map { n => consume(n) }
Minimum span (number of line breaks between first and last line) to start forcing blank lines.
Forces a blank line before and/or after a top-level statement.
If never
(default), it will remove any extra lines below curly lambdas
something.map { x =>
f(x)
}
will become
something.map { x =>
f(x)
}
If always
, it will always add one empty line (opposite of never
).
If preserve
, and there isn't an empty line, it will keep it as it is.
If there is one or more empty lines, it will place a single empty line.
If squash
, it will try to squash lambda body in one line:
xs.map { x => x + 1 }
will become
xs.map { x => x + 1 }
if true, add a new line between the end of a curly if and the following else. For example if(someCond) { // ... } else //...
If true, add a newline before the body of a multiline def without curly braces. See #1126 for discussion. For example,
// newlines.alwaysBeforeMultilineDef = false def foo(bar: Bar): Foo = bar .flatMap(f) .map(g) // newlines.alwaysBeforeMultilineDef = true def foo(bar: Bar): Foo = bar .flatMap(f) .map(g)
Controls how line breaks around operations are handled
If keep
(default for source=classic,keep), preserve existing
If some
(default for source=fold), break after some infix ops
If many
(default for source=unfold), break after many infix ops
Force breaks around nested (enclosed in parentheses) expressions
Switch to many
for a given expression (possibly nested) if the
number of operations in that expression exceeds this value AND
afterInfix
had been set to some
.
Switch to keep
for a given file if the total number of infix
operations in that file exceeds this value
If false (legacy behavior), inserts unconditional line break after yield
if the yield body doesn't fit on a single line.
For example,
// newlines.avoidAfterYield = true (default) for (a <- as) yield Future { ... } // newlines.avoidAfterYield = false (default before v2). for (a <- as) yield Future { ... }
If never
(default), it will remove any extra lines below curly lambdas
If never
(default), it will remove any extra lines below curly lambdas
something.map { x =>
f(x)
}
will become
something.map { x =>
f(x)
}
If always
, it will always add one empty line (opposite of never
).
If preserve
, and there isn't an empty line, it will keep it as it is.
If there is one or more empty lines, it will place a single empty line.
If squash
, it will try to squash lambda body in one line:
xs.map { x => x + 1 }
will become
xs.map { x => x + 1 }
Controls how line breaks around operations are handled
If keep
(default for source=classic,keep), preserve existing
If some
(default for source=fold), break after some infix ops
If many
(default for source=unfold), break after many infix ops
Force breaks around nested (enclosed in parentheses) expressions
Switch to many
for a given expression (possibly nested) if the
number of operations in that expression exceeds this value AND
afterInfix
had been set to some
.
Switch to keep
for a given file if the total number of infix
operations in that file exceeds this value
If true, puts a newline after the open brace and the parameters list of an anonymous function.
If true, puts a newline after the open brace and the parameters list of an anonymous function. For example something.map { n => consume(n) }
if true, add a new line between the end of a curly if and the following else.
if true, add a new line between the end of a curly if and the following else. For example if(someCond) { // ... } else //...
If true, add a newline before the body of a multiline def without curly braces.
If true, add a newline before the body of a multiline def without curly braces. See #1126 for discussion. For example,
// newlines.alwaysBeforeMultilineDef = false def foo(bar: Bar): Foo = bar .flatMap(f) .map(g) // newlines.alwaysBeforeMultilineDef = true def foo(bar: Bar): Foo = bar .flatMap(f) .map(g)
If false (legacy behavior), inserts unconditional line break after yield
if the yield body doesn't fit on a single line.
If false (legacy behavior), inserts unconditional line break after yield
if the yield body doesn't fit on a single line.
For example,
// newlines.avoidAfterYield = true (default) for (a <- as) yield Future { ... } // newlines.avoidAfterYield = false (default before v2). for (a <- as) yield Future { ... }
If true, a newline will never be placed in front of js.native.
If true, adds a penalty to newlines before a dot starting a select chain of length one and argument list.
If true, adds a penalty to newlines before a dot starting a select chain of length one and argument list. The penalty matches the number of arguments to the select chain application.
// If true, favor logger.elem(a, b, c) // instead of logger .elem(a, b, c) // penalty is proportional to argument count, example: logger.elem(a, b, c) // penalty 2 logger.elem(a, b, c, d) // penalty 3, etc.
If false, matches pre-v0.5 behavior. Note. this option may be removed in a future release.
If true, scalafmt may choose to put a newline before colon : at defs.
Controls how line breaks in the input source are handled
If classic
(default), the old mixed behaviour will be used
If keep
, try to keep source newlines
If fold
, ignore source and try to remove line breaks
If unfold
, ignore source and try to break lines
Forces a blank line before and/or after a top-level statement.
Minimum span (number of line breaks between first and last line) to start forcing blank lines.
Controls how line breaks in the input source are handled If
classic
(default), the old mixed behaviour will be used Ifkeep
, try to keep source newlines Iffold
, ignore source and try to remove line breaks Ifunfold
, ignore source and try to break linesIf true, a newline will never be placed in front of js.native.
If true, scalafmt may choose to put a newline before colon : at defs.
If true, adds a penalty to newlines before a dot starting a select chain of length one and argument list. The penalty matches the number of arguments to the select chain application.
If false, matches pre-v0.5 behavior. Note. this option may be removed in a future release.
If true, puts a newline after the open brace and the parameters list of an anonymous function. For example something.map { n => consume(n) }
Minimum span (number of line breaks between first and last line) to start forcing blank lines.
Forces a blank line before and/or after a top-level statement.
If
never
(default), it will remove any extra lines below curly lambdassomething.map { x => f(x) }
will become
something.map { x => f(x) }
If
always
, it will always add one empty line (opposite ofnever
). Ifpreserve
, and there isn't an empty line, it will keep it as it is. If there is one or more empty lines, it will place a single empty line. Ifsquash
, it will try to squash lambda body in one line:will become
if true, add a new line between the end of a curly if and the following else. For example if(someCond) { // ... } else //...
If true, add a newline before the body of a multiline def without curly braces. See #1126 for discussion. For example,
Controls how line breaks around operations are handled If
keep
(default for source=classic,keep), preserve existing Ifsome
(default for source=fold), break after some infix ops Ifmany
(default for source=unfold), break after many infix opsForce breaks around nested (enclosed in parentheses) expressions
Switch to
many
for a given expression (possibly nested) if the number of operations in that expression exceeds this value ANDafterInfix
had been set tosome
.Switch to
keep
for a given file if the total number of infix operations in that file exceeds this valueIf false (legacy behavior), inserts unconditional line break after
yield
if the yield body doesn't fit on a single line. For example,