Skip to content

Issue #36: Updated CheckstyleAutoFix to load checkstyle-config. #39

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

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

Anmol202005
Copy link
Collaborator

@Anmol202005 Anmol202005 commented Jul 7, 2025

Fixes: #36
Updated Updated CheckstyleAutoFix to load checkstyle-config.

Implemented property configuration as applied in checkstyle Main.java (https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/Main.java#L370).

Created Configuration Class to store checkstyle configuration.

@rdiachenko rdiachenko self-assigned this Jul 8, 2025
@Anmol202005 Anmol202005 force-pushed the loadConfig branch 2 times, most recently from ee86ef3 to 06f3e1c Compare July 9, 2025 16:52
@Anmol202005
Copy link
Collaborator Author

@rdiachenko
Added getChildByName(String name) and getParent() methods to the model class, these should help streamline the logic in other checks. Will make use of them in the header recipe as well :)

return children;
}

public String getProperty(String childName) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add more getxxx methods

getIntProperty()
getBooleanProperty()

so that we will hide data type conversion in this class and will avoid having boilerplate code across the codebase

what do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timurt
done.

may add other methods later if needed :)

Copy link
Collaborator

@rdiachenko rdiachenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's merge it as it blocks other issues, we will iterate on the logic and improve as part of PRs where we start using it

@rdiachenko rdiachenko merged commit 86d6fd4 into checkstyle:main Jul 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

load checkstyle config from config file uri
3 participants