Format

mill.scalalib.spotless.Format
See theFormat companion class
object Format

Attributes

Companion
class
Source
Format.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Format.type

Members list

Type members

Classlikes

@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/java/CleanthatJavaStep.java CleanthatJavaStep]]\n */")
case class CleanthatJava(groupArtifact: String, version: String, sourceJdkVersion: String, mutators: Seq[String], excludedMutators: Seq[String], includeDraft: Boolean) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * Represents a string value that can be inlined as `content` or must be read from `file`.\n */")
case class ContentOrFile(content: String, file: RelPathRef)

Represents a string value that can be inlined as content or must be read from file.

Represents a string value that can be inlined as content or must be read from file.

Attributes

Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/kotlin/DiktatStep.java DiktatStep]]\n */")
case class Diktat(version: String, isScript: Boolean, configFile: RelPathRef) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/generic/EndWithNewlineStep.java EndWithNewlineStep]]\n */")
case class EndWithNewline() extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * When `preserve` is set, `steps` are applied outside matching blocks, thus preserving the\n * formatting inside a matching block. Otherwise, `steps` are applied inside matching blocks.\n * @param name name of this step\n * @param regex matcher for a block\n * - `[regex]`: regular expression\n * - `[open,close]`: open and close markers\n * @see\n * - [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/generic/FenceStep.java FenceStep]]\n * - [[https://github.com/diffplug/spotless/tree/main/plugin-gradle#spotlessoff-and-spotlesson Toggle]]\n * - [[https://github.com/diffplug/spotless/tree/main/plugin-gradle#inception-languages-within-languages-within Inception]]\n */")
case class Fence(name: String, regex: Seq[String], preserve: Boolean, steps: Seq[Step]) extends Step

When preserve is set, steps are applied outside matching blocks, thus preserving the formatting inside a matching block. Otherwise, steps are applied inside matching blocks.

When preserve is set, steps are applied outside matching blocks, thus preserving the formatting inside a matching block. Otherwise, steps are applied inside matching blocks.

Value parameters

name

name of this step

regex

matcher for a block - [regex]: regular expression - [open,close]: open and close markers

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/java/FormatAnnotationsStep.java FormatAnnotationsStep]]\n */")
case class FormatAnnotations(addedTypeAnnotations: Seq[String], removedTypeAnnotations: Seq[String]) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @param style `GOOGLE` | `ASOP`\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/java/GoogleJavaFormatStep.java GoogleJavaFormatStep]]\n */")
case class GoogleJavaFormat(groupArtifact: String, version: String, style: String, reflowLongStrings: Boolean, reorderImports: Boolean, formatJavadoc: Boolean) extends Step

Value parameters

style

GOOGLE | ASOP

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/java/ImportOrderStep.java ImportOrderStep]]\n */")
case class ImportOrder(importOrder: Seq[String], wildcardsLast: Boolean, semanticSort: Boolean, treatAsPackage: Set[String], treatAsClass: Set[String], forJava: Boolean) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @param `type` `TAB` | `SPACE`\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/generic/IndentStep.java IndentStep]]\n */")
case class Indent(`type`: String, numSpacesPerTab: Option[Int]) extends Step

Value parameters

`type`

TAB | SPACE

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/generic/Jsr223Step.java Jsr223Step]]\n */")
case class Jsr223(name: String, dependency: String, engine: String, script: ContentOrFile) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/kotlin/KtLintStep.java KtLintStep]]\n */")
case class KtLint(version: String, configFile: RelPathRef, customRuleSets: Seq[String]) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @param style `DEFAULT` | `META_FORMAT` | `DROPBOX_FORMAT` | `GOOGLE_FORMAT` | `KOTLINLANG_FORMAT`\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/kotlin/KtfmtStep.java KtfmtStep]]\n */")
case class Ktfmt(version: String, style: String, maxWidth: Option[Int], blockIndent: Option[Int], continuationIndent: Option[Int], removeUnusedImports: Option[Boolean], manageTrailingCommas: Option[Boolean]) extends Step

Value parameters

style

DEFAULT | META_FORMAT | DROPBOX_FORMAT | GOOGLE_FORMAT | KOTLINLANG_FORMAT

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @param yearMode `PRESERVE` | `UPDATE_TO_TODAY` | `SET_FROM_GIT`\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/generic/LicenseHeaderStep.java LicenseHeaderStep]]\n */")
case class LicenseHeader(delimiter: String, header: ContentOrFile, name: String, contentPattern: String, yearSeparator: String, yearMode: String, skipLinesMatching: String) extends Step

Value parameters

yearMode

PRESERVE | UPDATE_TO_TODAY | SET_FROM_GIT

Attributes

See also
Companion
object
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
object LicenseHeader

Attributes

Companion
class
Source
Format.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/generic/NativeCmdStep.java NativeCmdStep]]\n */")
case class NativeCmd(name: String, pathToExe: String, arguments: Seq[String]) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @param style `PALANTIR` | `GOOGLE` | `ASOP`\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/java/PalantirJavaFormatStep.java PalantirJavaFormatStep]]\n */")
case class PalantirJavaFormat(version: String, style: String, formatJavadoc: Boolean) extends Step

Value parameters

style

PALANTIR | GOOGLE | ASOP

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * A relative path reference resolved against a [[RelPathRef.withDynamicRoot configurable]] root\n * path. This is meant for usages where the machine specific root path prefix should be omitted.\n */")
case class RelPathRef

A relative path reference resolved against a configurable root path. This is meant for usages where the machine specific root path prefix should be omitted.

A relative path reference resolved against a configurable root path. This is meant for usages where the machine specific root path prefix should be omitted.

Attributes

Companion
object
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object RelPathRef

Attributes

Companion
class
Source
Format.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
RelPathRef.type
@Scaladoc(value = "/**\n * @param formatter `google-java-format` | `cleanthat-javaparser-unnecessaryimport`\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/java/RemoveUnusedImportsStep.java RemoveUnusedImportsStep]]\n */")
case class RemoveUnusedImports(formatter: Option[String]) extends Step

Value parameters

formatter

google-java-format | cleanthat-javaparser-unnecessaryimport

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/generic/ReplaceStep.java ReplaceStep]]\n */")
case class Replace(name: String, target: String, replacement: String) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/generic/ReplaceRegexStep.java ReplaceRegexStep]]\n */")
case class ReplaceRegex(name: String, regex: String, replacement: String) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/scala/ScalaFmtStep.java ScalaFmtStep]]\n */")
case class ScalaFmt(version: String, scalaMajorVersion: String, configFile: RelPathRef) extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * Configuration for building a Spotless formatter step.\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/FormatterStep.java FormatterStep]].\n */")
sealed trait Step

Configuration for building a Spotless formatter step.

Configuration for building a Spotless formatter step.

Attributes

See also
Source
Format.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Diktat
class Fence
class ImportOrder
class Indent
class Jsr223
class KtLint
class Ktfmt
class NativeCmd
class Replace
class ReplaceRegex
class ScalaFmt
Show all
@Scaladoc(value = "/**\n * A lint suppression definition.\n * @note When all members are `null`, all lints are suppressed.\n * @param path Relative path to file.\n * @param step Name of formatter step.\n * @param shortCode Name of lint.\n */")
case class Suppress(path: String, step: String, shortCode: String)

A lint suppression definition.

A lint suppression definition.

Value parameters

path

Relative path to file.

shortCode

Name of lint.

step

Name of formatter step.

Attributes

Note

When all members are null, all lints are suppressed.

Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
@Scaladoc(value = "/**\n * @see [[https://github.com/diffplug/spotless/blob/main/lib/src/main/java/com/diffplug/spotless/generic/TrimTrailingWhitespaceStep.java TrimTrailingWhitespaceStep]]\n */")
case class TrimTrailingWhitespace() extends Step

Attributes

See also
Source
Format.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Step
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

@Scaladoc(value = "/**\n * @note Use with [[RelPathRef.withDynamicRoot]] to configure any relative references.\n */")
def apply(includes: String*)(steps: Step*): Format

Attributes

Note

Use with RelPathRef.withDynamicRoot to configure any relative references.

Source
Format.scala
@Scaladoc(value = "/**\n * Default [[Format]] for files with `.java` extension.\n */")

Default Format for files with .java extension.

Default Format for files with .java extension.

Attributes

Source
Format.scala
@Scaladoc(value = "/**\n * Default [[Format]] for files with `.kt`, `.kts` extensions.\n */")

Default Format for files with .kt, .kts extensions.

Default Format for files with .kt, .kts extensions.

Attributes

Source
Format.scala
@Scaladoc(value = "/**\n * Default [[Format]] for files with `.scala`, `.sc`, `.mill` extensions.\n */")

Default Format for files with .scala, .sc, .mill extensions.

Default Format for files with .scala, .sc, .mill extensions.

Attributes

Source
Format.scala
@Scaladoc(value = "/**\n * A [[Format]] for `steps` that selects files with the given extensions.\n */")
def ext(eh: String, et: String*)(steps: Step*): Format

A Format for steps that selects files with the given extensions.

A Format for steps that selects files with the given extensions.

Attributes

Source
Format.scala

Givens

Givens

given derived$ReadWriter: ReadWriter[Format]

Attributes

Source
Format.scala