case class Newlines(neverInResultType: Boolean = false, neverBeforeJsNative: Boolean = false, sometimesBeforeColonInMethodReturnType: Boolean = true, penalizeSingleSelectMultiArgList: Boolean = true, alwaysBeforeCurlyBraceLambdaParams: Boolean = false, alwaysBeforeTopLevelStatements: Boolean = false, afterCurlyLambda: NewlineCurlyLambda = NewlineCurlyLambda.never, afterImplicitKWInVerticalMultiline: Boolean = false, beforeImplicitKWInVerticalMultiline: Boolean = false, alwaysBeforeElseAfterCurlyIf: Boolean = false, alwaysBeforeMultilineDef: Boolean = true, avoidAfterYield: Boolean = true) extends Product with Serializable

neverBeforeJsNative

If true, a newline will never be placed in front of js.native.

sometimesBeforeColonInMethodReturnType

If true, scalafmt may choose to put a newline before colon : at defs.

penalizeSingleSelectMultiArgList

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.

alwaysBeforeCurlyBraceLambdaParams

If true, puts a newline after the open brace and the parameters list of an anonymous function. For example something.map { n => consume(n) }

afterCurlyLambda

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.

alwaysBeforeElseAfterCurlyIf

if true, add a new line between the end of a curly if and the following else. For example if(someCond) { // ... } else //...

alwaysBeforeMultilineDef

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)
avoidAfterYield

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 {
    ...
  }
Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Newlines
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Newlines(neverInResultType: Boolean = false, neverBeforeJsNative: Boolean = false, sometimesBeforeColonInMethodReturnType: Boolean = true, penalizeSingleSelectMultiArgList: Boolean = true, alwaysBeforeCurlyBraceLambdaParams: Boolean = false, alwaysBeforeTopLevelStatements: Boolean = false, afterCurlyLambda: NewlineCurlyLambda = NewlineCurlyLambda.never, afterImplicitKWInVerticalMultiline: Boolean = false, beforeImplicitKWInVerticalMultiline: Boolean = false, alwaysBeforeElseAfterCurlyIf: Boolean = false, alwaysBeforeMultilineDef: Boolean = true, avoidAfterYield: Boolean = true)

    neverBeforeJsNative

    If true, a newline will never be placed in front of js.native.

    sometimesBeforeColonInMethodReturnType

    If true, scalafmt may choose to put a newline before colon : at defs.

    penalizeSingleSelectMultiArgList

    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.

    alwaysBeforeCurlyBraceLambdaParams

    If true, puts a newline after the open brace and the parameters list of an anonymous function. For example something.map { n => consume(n) }

    afterCurlyLambda

    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.

    alwaysBeforeElseAfterCurlyIf

    if true, add a new line between the end of a curly if and the following else. For example if(someCond) { // ... } else //...

    alwaysBeforeMultilineDef

    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)
    avoidAfterYield

    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 {
        ...
      }

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 afterCurlyLambda: NewlineCurlyLambda
  5. val alwaysBeforeCurlyBraceLambdaParams: Boolean
  6. val alwaysBeforeElseAfterCurlyIf: Boolean
  7. val alwaysBeforeMultilineDef: Boolean
  8. val alwaysBeforeTopLevelStatements: Boolean
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. val avoidAfterYield: Boolean
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. val neverBeforeJsNative: Boolean
  18. val neverInResultType: Boolean
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. val penalizeSingleSelectMultiArgList: Boolean
  22. def productElementNames: Iterator[String]
    Definition Classes
    Product
  23. val reader: ConfDecoder[Newlines]
  24. val sometimesBeforeColonInMethodReturnType: Boolean
  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. val afterImplicitKWInVerticalMultiline: Boolean
    Annotations
    @deprecated
    Deprecated

    Use VerticalMultiline.newlineAfterImplicitKW instead

  2. val beforeImplicitKWInVerticalMultiline: Boolean
    Annotations
    @deprecated
    Deprecated

    Use VerticalMultiline.newlineBeforeImplicitKW instead

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped