Package com.diffplug.gradle.spotless
Class BiomeStepConfig<Self extends BiomeStepConfig<Self>>
java.lang.Object
com.diffplug.gradle.spotless.BiomeStepConfig<Self>
- Direct Known Subclasses:
CssExtension.BiomeCss,FormatExtension.BiomeGeneric,JavascriptExtension.BiomeJs,JsonExtension.BiomeJson,TypescriptExtension.BiomeTs
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBiomeStepConfig(Project project, Consumer<FormatterStep> replaceStep, String version) -
Method Summary
Modifier and TypeMethodDescriptionconfigPath(Object configPath) Optional path to the directory with configuration file for Biome.protected FormatterStepCreates a new formatter step that formats code by calling the Biome executable, using the current configuration.downloadDir(Object downloadDir) Optional directory where the downloaded Biome executable is placed.protected abstract StringGets the language (syntax) of the input files to format.protected abstract SelfgetThis()Optional path to the Biome executable.protected voidCreates a new Biome step and replaces the existing Biome step in the list of format steps.
-
Constructor Details
-
BiomeStepConfig
-
-
Method Details
-
configPath
Optional path to the directory with configuration file for Biome. The file must be namedbiome.json. When none is given, the default configuration is used. If this is a relative path, it is resolved against the project's base directory.- Returns:
- This step for further configuration.
-
downloadDir
Optional directory where the downloaded Biome executable is placed. If this is a relative path, it is resolved against the project's base directory. Defaults to~/.m2/repository/com/diffplug/spotless/spotless-data/biome.- Returns:
- This step for further configuration.
-
pathToExe
Optional path to the Biome executable. Overwrites the configured version. No attempt is made to download the Biome executable from the network.When an absolute path is given, that path is used as-is. When a relative path is given, it is resolved against the project's base directory. When only a file name (i.e. without any slashes or back slash path separators such as
biome) is given, this is interpreted as the name of a command with executable that is in yourpathenvironment variable. Use./executable-nameif you want to use an executable in the project's base directory.- Returns:
- This step for further configuration.
-
createStep
Creates a new formatter step that formats code by calling the Biome executable, using the current configuration.- Returns:
- A new formatter step for the Biome formatter.
-
getLanguage
Gets the language (syntax) of the input files to format. Whennullor the empty string, the language is detected automatically from the file name. Currently, the following languages are supported by Biome:- js (JavaScript)
- jsx (JavaScript + JSX)
- js? (JavaScript or JavaScript + JSX, depending on the file extension)
- ts (TypeScript)
- tsx (TypeScript + JSX)
- ts? (TypeScript or TypeScript + JSX, depending on the file extension)
- css (CSS, requires biome >= 1.9.0)
- json (JSON)
- jsonc (JSON + comments)
- Returns:
- The language of the input files.
-
getThis
- Returns:
- This Biome config instance.
-
replaceStep
protected void replaceStep()Creates a new Biome step and replaces the existing Biome step in the list of format steps.
-