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

Enable auto discovery of Checkstyle config file via gradle plugin #338

Open
blipper opened this issue Oct 11, 2024 · 0 comments
Open

Enable auto discovery of Checkstyle config file via gradle plugin #338

blipper opened this issue Oct 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@blipper
Copy link
Contributor

blipper commented Oct 11, 2024

What problem are you trying to solve?

Easy of configuration for initial users

Describe the solution you'd like

private List<NamedStyles> getStyles() {
if (styles == null) {
styles = environment().activateStyles(getActiveStyles());
File checkstyleConfig = extension.getCheckstyleConfigFile();
if (checkstyleConfig != null && checkstyleConfig.exists()) {
try {
styles.add(CheckstyleConfigLoader.loadCheckstyleConfig(checkstyleConfig.toPath(), extension.getCheckstyleProperties()));
} catch (Exception e) {
logger.warn("Unable to parse Checkstyle configuration", e);
}
}
}
return styles;
}
has the code to load checkfile config files.

It would be great if the plugin could A) detect if the checkstyle plugin was loaded
B) at task execution time us the configFile value automatically from https://docs.gradle.org/current/dsl/org.gradle.api.plugins.quality.CheckstyleExtension.html#org.gradle.api.plugins.quality.CheckstyleExtension:configFile

Have you considered any alternatives or workarounds?

You can manually configure this but non-obvious.

Additional context

Are you interested in contributing this feature to OpenRewrite?

@blipper blipper added the enhancement New feature or request label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant