Home

Awesome

Gradle Scapegoat Plugin

CircleCI

Gradle plugin enables a simple configuration of Scapegoat Scala static code analysis tool. The plugin provides default values for the linter allowing to overwrite them.

Configuration

To enable the plugin in the Gradle script:

Configuration options are:

For the full list of available inspections, check the corresponding Scapegoat README section.

For the full list of available compiler options, check compiler flag section.

Example configuration:

plugins {
  id "com.github.eugenesy.scapegoat" version "0.2.0"
}

scapegoat {
  scapegoatVersion = "1.4.8"
  scalaVersion = "2.12.13"
  dataDir = "${buildDir}/reports/scapegoat"
  disabledInspections = []
  ignoredFiles = []
  consoleOutput = true
  verbose = true
  reports = ["html", "xml"]
  sourcePrefix = "src/main/scala"
  minimalWarnLevel = "info"
  enable = true
  testEnable = true
}
plugins {
  id("com.github.eugenesy.scapegoat") version "0.2.0"
}

configure<com.github.eugenesy.scapegoat.ScapegoatExtension>  {
    scapegoatVersion = "1.4.8"
    scalaVersion = "2.12.13"
    dataDir = "${buildDir}/reports/scapegoat"
    disabledInspections = arrayListOf("ArrayEquals", "AvoidToMinusOne")
    ignoredFiles = emptyArray<String>().toList()
    consoleOutput = true
    verbose = true
    reports = arrayListOf<String>("html", "xml")
    sourcePrefix = "src/main/scala"
    minimalWarnLevel = "info"
    enable = true
    testEnable = true
}

For more details, check examples.

Compatibility

The plugin is dependent on Kotlin runtime, provided by Gradle. Kotlin API 1.3 is deprecated and is being removed soon.

Plugin versionMinimal Gradle VersionKotlin API
0.1.45.31.3
0.2.06.51.4

Changelog

0.2.0

0.1.4

0.1.3

0.1.0

The initial release of the plugin.

License

Copyright 2020 Eugene Sypachev

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.