Skip to content

Reacting to checkstyle plugin #443

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

Open
quaff opened this issue May 28, 2025 · 1 comment
Open

Reacting to checkstyle plugin #443

quaff opened this issue May 28, 2025 · 1 comment

Comments

@quaff
Copy link

quaff commented May 28, 2025

It would be nice if io.spring.javaformat gradle plugin add dependency io.spring.javaformat:spring-javaformat-checkstyle to checkstyle configuration.

Given:

plugins {
	java
	checkstyle
	id("io.spring.javaformat").version("0.0.45")
}

Then:

dependencies {
	checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.45")
}

should be optional.

@wilkinsona
Copy link
Contributor

I've had this at the back of my mind for a while and I do think it would be useful, but I've never done anything about it as it's not as straightforward as it first appears to be. A few things that we'd have to keep in mind:

  • Adding a dependency to the checkstyle configuration replaces the default dependency on com.puppycrawl.tools:checkstyle. We'd probably need to add it back again and consider the checkstyle.toolVersion property when doing so
  • Some users may want this plugin's formatting but not want its Checkstyle integration. They'd need a way to disable the automatic configuration of Checkstyle. A property, configured in gradle.properties, would be the easiest. A DSL would be nicer but this is complicated as it requires the dependency to be added lazily once the user's had a chance to configure things using the DSL
  • Can we somehow configure things so that our pre-canned checkstyle.xml is used by default?

@wilkinsona wilkinsona added this to the 0.0.x milestone May 28, 2025
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