Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide configDirectory property for Checkstyle plugin #29

Closed
baev opened this issue Nov 16, 2020 · 1 comment
Closed

Provide configDirectory property for Checkstyle plugin #29

baev opened this issue Nov 16, 2020 · 1 comment

Comments

@baev
Copy link

baev commented Nov 16, 2020

This property is required in order to have config_loc variable set, for example to use it with SuppressionFilter module:

<module name="SuppressionFilter">
    <property name="file" value="${config_loc}/suppressions.xml"/>
</module>

https://docs.gradle.org/current/dsl/org.gradle.api.plugins.quality.CheckstyleExtension.html#org.gradle.api.plugins.quality.CheckstyleExtension:configDirectory

FYI: as workaround I use afterEvaluate to pass configDirectory to Checkstyle and it works just fine

@xvik xvik closed this as completed in f1a0872 Feb 6, 2021
@xvik
Copy link
Owner

xvik commented Feb 6, 2021

checkstyle.configDirectory set to gradle/config/checkstyle/ (by default)

Also, suppressions filter added to the default file:

<module name="SuppressionFilter">
        <property name="file" value="${config_loc}/suppressions.xml"/>
        <property name="optional" value="true"/>
</module>

(with optional=true to ignore absent file)

So it would be enough now to just drop custom suppressions.xml into gradle/config/checkstyle/ and it would be used automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants