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 annotated
- 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 annotated
- if newlines.source is missing or keep:
- 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 }
- Alphabetic
- By Inheritance
- OptIn
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- 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 annotated
- 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 annotated
- if newlines.source is missing or keep:
- 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
- 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 annotationNewlines: Boolean
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val blankLineBeforeDocstring: Boolean
- val breakChainOnFirstMethodDot: Boolean
- val breaksInsideChains: Boolean
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val configStyleArguments: Boolean
- val encloseClassicChains: Boolean
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- val forceBlankLineBeforeDocstring: Boolean
- 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 toblankLineBeforeDocstring(old config) which may be configured in .scalafmt.conf ifforceBlankLineBeforeDocstringconfigured to non-default value don't look at the old name - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val selfAnnotationNewline: Boolean
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()