Class RomeStepConfig<Self extends RomeStepConfig<Self>>

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected RomeStepConfig​(Project project, java.util.function.Consumer<FormatterStep> replaceStep, com.diffplug.spotless.rome.BiomeFlavor flavor, java.lang.String version)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      Self configPath​(java.lang.Object configPath)
      Optional path to the directory with configuration file for Biome.
      protected FormatterStep createStep()
      Creates a new formatter step that formats code by calling the Biome executable, using the current configuration.
      Self downloadDir​(java.lang.Object downloadDir)
      Optional directory where the downloaded Biome executable is placed.
      protected abstract java.lang.String getLanguage()
      Gets the language (syntax) of the input files to format.
      protected abstract Self getThis()  
      Self pathToExe​(java.lang.Object pathToExe)
      Optional path to the Biome executable.
      protected void replaceStep()
      Creates a new Biome step and replaces the existing Biome step in the list of format steps.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RomeStepConfig

        protected RomeStepConfig​(Project project,
                                 java.util.function.Consumer<FormatterStep> replaceStep,
                                 com.diffplug.spotless.rome.BiomeFlavor flavor,
                                 java.lang.String version)
    • Method Detail

      • configPath

        public Self configPath​(java.lang.Object configPath)
        Optional path to the directory with configuration file for Biome. The file must be named biome.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

        public Self downloadDir​(java.lang.Object 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

        public Self pathToExe​(java.lang.Object 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 your path environment variable. Use ./executable-name if you want to use an executable in the project's base directory.

        Returns:
        This step for further configuration.
      • createStep

        protected FormatterStep 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

        protected abstract java.lang.String getLanguage()
        Gets the language (syntax) of the input files to format. When null or 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)
        • json (JSON)
        Returns:
        The language of the input files.
      • getThis

        protected abstract Self 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.