gradle-scalastyle-plugin icon indicating copy to clipboard operation
gradle-scalastyle-plugin copied to clipboard

Do not check test source set with configuration for main when testConfigLocation is defined

Open lunaticare opened this issue 6 years ago • 0 comments

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.

lunaticare avatar Nov 08 '18 11:11 lunaticare