ngbinh / gradle-scalastyle-plugin

Gradle plugin for scalastyle
18 stars 16 forks source link

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

Open lunaticare opened 5 years ago

lunaticare commented 5 years ago

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: