Skip to content

Conversation

@Pankraz76
Copy link

@Pankraz76 Pankraz76 commented Jun 1, 2025

give demo for Spotless auto fix capability. Its nice to see that check is, by dedicated plugin, highly integrated.
Never the less haven not spotted yet some problems solver for the issues being pointed out by static code analysis.

Spot integrates nifty providing numerous styles out of the box. Having the whole codebase on the fingertips with this capable plugin.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 1, 2025
"-Xlint:empty",
"-Xlint:finally",
"-Xlint:overrides",
"-Xlint:path",
Copy link
Author

Choose a reason for hiding this comment

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

promotes block format having one thing only (per line).

import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction;

import static org.springframework.build.architecture.ArchitectureRules.allPackagesShouldBeFreeOfTangles;
Copy link
Author

Choose a reason for hiding this comment

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

could adjust import order.


static ArchRule noClassesShouldCallStringToLowerCaseWithoutLocale() {
return ArchRuleDefinition.noClasses()
.should()
Copy link
Author

Choose a reason for hiding this comment

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

this indentations seems a little bit too much. questioning current tooling.

*/
public void apply(Project project) {
project.getPlugins().withType(JavaBasePlugin.class, (_) -> {
project.getPlugins().apply(com.diffplug.gradle.spotless.SpotlessPlugin.class);
Copy link
Author

Choose a reason for hiding this comment

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

Cannot resolve symbol 'SpotlessPlugin'

@Pankraz76
Copy link
Author

is this any good? @bclozel

if so would need help on the plugin import.

thanks.

@bclozel
Copy link
Member

bclozel commented Jun 2, 2025

Thanks for the proposal but we are not interested in Maven Spotless at the moment.
Our use of checkstyle fits our needs quite well right now. If we would like to have a more complete, automated, integrated solution, I think we would use https://github.com/spring-io/spring-javaformat/.

@bclozel bclozel closed this Jun 2, 2025
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 2, 2025
@Pankraz76
Copy link
Author

agree upon, thanks for teaching me about this auto format solution for check.

Might be something to go beyond the idea limitation bound into: @romani

Its nice to have auto fix but only for IDEA users seems short.

As this tool is limited to spring style, it might not fit for desired check style.

@Pankraz76
Copy link
Author

[ant:checkstyle] [ERROR] /Users/vincent.potucek/IdeaProjects/spring-framework/spring-web/src/main/java/org/springframework/http/converter/ResourceHttpMessageConverter.java:19:8: Unused import - java.io.FileNotFoundException. [UnusedImports]
[ant:checkstyle] [ERROR] /Users/vincent.potucek/IdeaProjects/spring-framework/spring-web/src/main/java/org/springframework/http/converter/ResourceHttpMessageConverter.java:22:8: Unused import - java.io.OutputStream. [UnusedImports]

how to apply ? simply building is not fixing simply flaws like quarkus build by using similar plugin. its slowing down development.

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

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants