Skip to content

A plugin to enhance the Scala gradle core plugin with quality assurance tools

License

Notifications You must be signed in to change notification settings

tassiluca/gradle-scala-extras

Repository files navigation

Gradle Scala Extras

This Gradle plugin aims to enhance the Scala Gradle core plugin with quality assurance tools and custom configurations.

Features

  • Support for Scalafix and Scalafmt with a default configuration that can be overridden following the How to use section.
  • Aggressive Scala compiler option to treat warnings as errors is applied by default (still configurable).

Other features may come in the future.

How to use

plugins {
    id("io.github.tassiluca.gradle-scala-extras") version "<SELECT THE VERSION>"
}

The plugin is configurable through the scalaExtras extension:

scalaExtras {
    qa { 
        allWarningsAsErrors = false
        scalafix {
            configFile = "stringified path to the scalafix configuration"
        }
        scalafmt {
            configFile = "stringified path to the scalafmt configuration"
        } 
    }
}
  • allWarningsAsErrors is a boolean property that allows to disable the aggressive compiler option to treat warnings as errors;
  • configFile is a string that allows to set the path to the Scalafix / Scalafmt configuration file;
    • if not set, the plugin will search for a .scalafix.conf / .scalafmt.conf file in the project root directory. If not found, the default configuration is applied;
    • Default configurations can be found here.