Skip to content

Plugin Configuration

moznion edited this page May 8, 2020 · 15 revisions

Plugin configuration; across the formatters.

Example

import net.moznion.sbt.spotless.config._

lazy val root = (project in file("."))
  .settings(
    name := "Example",
    spotless := SpotlessConfig(
      baseDir = null,
      dynamicDependencyWorkingDir = null,
      dynamicDependencyCacheDir = null,
      disableDynamicDependencyCache = false,
      disableDynamicDependencyResolving = false,
      checkOnCompile = false,
      applyOnCompile = false,
    ),
  )

Setting Key

spotless: SpotlessConfig

Items

baseDir: Target

Default value: sbt project root

The base directory for this plugin.

dynamicDependencyWorkingDir: Target

Default value: ${target.value}

A directory to resolve and install the dynamic dependency.

for more information about ${target.value}: https://www.scala-sbt.org/1.x/docs/Best-Practices.html#Don%E2%80%99t+hard+code

dynamicDependencyCacheDir: Target

Default value: ${dynamicDependencyWorkingDir}/.spotlessDepCache

A directory to save cache files for the resolved dynamic dependency.

disableDynamicDependencyResolving: Boolean

Default value: false

Specifier to disable dynamic dependency resolving or not. If you disable the resolution by this parameter, you have to specify the dependency explicitly in your build.sbt.

disableDynamicDependencyCache: Boolean

Default value: false

Specifier to disable caching for dynamic dependency.

noFailOnViolated: Boolean

Default value: false

If this value is set true, a task won't fail even if a task detects any violation.

(sbt 1.3 only) checkOnCompile: Boolean

Default value: false

If this value is true, it hooks spotlessCheck task on a compile phase.

(sbt 1.3 only) applyOnCompile: Boolean

Default value: false

If this value is true, it hooks spotlessApply task on a compile phase.
This parameter overrides the checkOnCompile option if that is used.