case class OptIn(configStyleArguments: Boolean = true, breaksInsideChains: Boolean = false, breakChainOnFirstMethodDot: Boolean = true, encloseClassicChains: Boolean = false, selfAnnotationNewline: Boolean = true, annotationNewlines: Boolean = true, forceBlankLineBeforeDocstring: Boolean = true, blankLineBeforeDocstring: Boolean = false) extends Product with Serializable

configStyleArguments

Call-sites where there is a newline after opening ( and newline before closing ). If true, preserves the newlines and keeps one line per argument.

breaksInsideChains

NB: failure unless newlines.source=classic If true, then the user can opt out of line breaks inside select chains.

// original
foo
  .map(_ + 1).map(_ + 1)
  .filter(_ > 2)
// if true
foo
  .map(_ + 1).map(_ + 1)
  .filter(_ > 2)
// if false
foo
  .map(_ + 1)
  .map(_ + 1)
  .filter(_ > 2)
breakChainOnFirstMethodDot

NB: ignored unless newlines.source=classic If true, keeps the line break before a dot if it already exists.

// original
foo
  .map(_ + 1)
  .filter( > 2)
// if true
foo
  .map(_ + 1)
  .filter( > 2)
// if false
foo.map(_ + 1).filter( > 2)
encloseClassicChains

NB: ignored unless newlines.source=classic. Controls what happens if a chain enclosed in parentheses is followed by additional selects. Those additional selects will be considered part of the enclosed chain if and only if this flag is false.

// original
(foo.map(_ + 1).map(_ + 1))
  .filter(_ > 2)
// if true
(foo.map(_ + 1).map(_ + 1))
  .filter(_ > 2)
// if false
(foo
  .map(_ + 1)
  .map(_ + 1))
  .filter(_ > 2)
selfAnnotationNewline

See https://github.com/scalameta/scalafmt/issues/938 If true, will force a line break before a self annotation if there was a line break there before.

annotationNewlines

  • if newlines.source is missing or keep:
    • if true, will keep existing line breaks around annotations
  • if newlines.source is fold:
    • if true, will break before the entity being annotatated
    • will not force break between consecutive annotations
  • if newlines.source is unfold:
    • if true, will break between consecutive annotations
    • will always break before the entity being annotatated
forceBlankLineBeforeDocstring

If true, always insert a blank line before docstrings, If false, preserves blank line only if one exists before. Example:

// before
object Foo {
  /** Docstring */
  def foo = 2
}
// after, if forceBlankLineBeforeDocstring=false
object Foo {
  /** Docstring */
  def foo = 2
}
// after, if forceBlankLineBeforeDocstring=true
object Foo {

  /** Docstring */
  def foo = 2
}
Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OptIn
  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 OptIn(configStyleArguments: Boolean = true, breaksInsideChains: Boolean = false, breakChainOnFirstMethodDot: Boolean = true, encloseClassicChains: Boolean = false, selfAnnotationNewline: Boolean = true, annotationNewlines: Boolean = true, forceBlankLineBeforeDocstring: Boolean = true, blankLineBeforeDocstring: Boolean = false)

    configStyleArguments

    Call-sites where there is a newline after opening ( and newline before closing ). If true, preserves the newlines and keeps one line per argument.

    breaksInsideChains

    NB: failure unless newlines.source=classic If true, then the user can opt out of line breaks inside select chains.

    // original
    foo
      .map(_ + 1).map(_ + 1)
      .filter(_ > 2)
    // if true
    foo
      .map(_ + 1).map(_ + 1)
      .filter(_ > 2)
    // if false
    foo
      .map(_ + 1)
      .map(_ + 1)
      .filter(_ > 2)
    breakChainOnFirstMethodDot

    NB: ignored unless newlines.source=classic If true, keeps the line break before a dot if it already exists.

    // original
    foo
      .map(_ + 1)
      .filter( > 2)
    // if true
    foo
      .map(_ + 1)
      .filter( > 2)
    // if false
    foo.map(_ + 1).filter( > 2)
    encloseClassicChains

    NB: ignored unless newlines.source=classic. Controls what happens if a chain enclosed in parentheses is followed by additional selects. Those additional selects will be considered part of the enclosed chain if and only if this flag is false.

    // original
    (foo.map(_ + 1).map(_ + 1))
      .filter(_ > 2)
    // if true
    (foo.map(_ + 1).map(_ + 1))
      .filter(_ > 2)
    // if false
    (foo
      .map(_ + 1)
      .map(_ + 1))
      .filter(_ > 2)
    selfAnnotationNewline

    See https://github.com/scalameta/scalafmt/issues/938 If true, will force a line break before a self annotation if there was a line break there before.

    annotationNewlines

    • if newlines.source is missing or keep:
      • if true, will keep existing line breaks around annotations
    • if newlines.source is fold:
      • if true, will break before the entity being annotatated
      • will not force break between consecutive annotations
    • if newlines.source is unfold:
      • if true, will break between consecutive annotations
      • will always break before the entity being annotatated
    forceBlankLineBeforeDocstring

    If true, always insert a blank line before docstrings, If false, preserves blank line only if one exists before. Example:

    // before
    object Foo {
      /** Docstring */
      def foo = 2
    }
    // after, if forceBlankLineBeforeDocstring=false
    object Foo {
      /** Docstring */
      def foo = 2
    }
    // after, if forceBlankLineBeforeDocstring=true
    object Foo {
    
      /** Docstring */
      def foo = 2
    }

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 annotationNewlines: Boolean
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val blankLineBeforeDocstring: Boolean
  7. val breakChainOnFirstMethodDot: Boolean
  8. val breaksInsideChains: Boolean
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. val configStyleArguments: Boolean
  11. val encloseClassicChains: Boolean
  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. val forceBlankLineBeforeDocstring: Boolean
  15. lazy val forceNewlineBeforeDocstringSummary: Boolean

    See https://github.com/scalameta/scalafmt/issues/1712

    See https://github.com/scalameta/scalafmt/issues/1712

    Setting behavior and name were mirrored. After deprecation and right naming we need to: if forceBlankLineBeforeDocstring (new name) has default value (true) fallback to blankLineBeforeDocstring (old config) which may be configured in .scalafmt.conf if forceBlankLineBeforeDocstring configured to non-default value don't look at the old name

  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. def productElementNames: Iterator[String]
    Definition Classes
    Product
  22. implicit val reader: ConfDecoder[OptIn]
  23. val selfAnnotationNewline: Boolean
  24. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped