gradle-scalastyle-plugin
gradle-scalastyle-plugin copied to clipboard
Do not check test source set with configuration for main when testConfigLocation is defined
When I use the following configuration:
scalaStyle {
configLocation = "scalastyle-config_main.xml"
testConfigLocation = "scalastyle-config_test.xml"
includeTestSourceDirectory = true
source = "src/main/scala"
testSource = "src/test/scala"
}
, the test source set is checked twice with configLocation
and testConfigLocation
configurations, resulting in unnecessary warnings for test source set since the rules for test source set are less strict in my case.
If I set includeTestSourceDirectory
to false, code is checked as expected, the main source set with configLocation
config and the test source set with testConfigLocation
config.
I suggest that:
- either documentation should say that
includeTestSourceDirectory = true
uses configLocation configuration; - or fix the plugin so
includeTestSourceDirectory = true
uses testConfigLocation if defined,configLocation
otherwise.