Skip to content

Commit

Permalink
Sync checkstyle on buildSrc
Browse files Browse the repository at this point in the history
Closes spring-projectsgh-34434
Signed-off-by: Vincent Potucek <[email protected]>
  • Loading branch information
pinguin3245678 authored and bclozel committed Feb 18, 2025
1 parent 63f6c33 commit 67d2635
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
13 changes: 6 additions & 7 deletions buildSrc/config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="com.puppycrawl.tools.checkstyle.Checker">
<module name="Checker">

<!-- Root Checks -->
<module name="io.spring.javaformat.checkstyle.check.SpringHeaderCheck">
Expand All @@ -12,16 +12,15 @@
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck"/>

<!-- TreeWalker Checks -->
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<module name="TreeWalker">

<!-- Imports -->
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck">
<property name="processJavadoc" value="true"/>
</module>

<module name="AvoidStarImport"/>
<module name="UnusedImports"/>
<module name="RedundantImport"/>
<!-- Modifiers -->
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>

</module>

</module>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@
import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction;

import static org.springframework.build.architecture.ArchitectureRules.*;
import static org.springframework.build.architecture.ArchitectureRules.allPackagesShouldBeFreeOfTangles;
import static org.springframework.build.architecture.ArchitectureRules.classesShouldNotImportForbiddenTypes;
import static org.springframework.build.architecture.ArchitectureRules.javaClassesShouldNotImportKotlinAnnotations;
import static org.springframework.build.architecture.ArchitectureRules.noClassesShouldCallStringToLowerCaseWithoutLocale;
import static org.springframework.build.architecture.ArchitectureRules.noClassesShouldCallStringToUpperCaseWithoutLocale;
import static org.springframework.build.architecture.ArchitectureRules.packageInfoShouldBeNullMarked;

/**
* {@link Task} that checks for architecture problems.
Expand Down
12 changes: 5 additions & 7 deletions src/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="com.puppycrawl.tools.checkstyle.Checker">
<module name="Checker">

<!-- Suppressions -->
<module name="SuppressionFilter">
Expand All @@ -18,7 +18,7 @@
<module name="JavadocPackage" /><!-- package-info.java -->

<!-- TreeWalker Checks -->
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<module name="TreeWalker">

<!-- Annotations -->
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck">
Expand Down Expand Up @@ -89,11 +89,9 @@
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>

<!-- Imports -->
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck">
<property name="processJavadoc" value="true"/>
</module>
<module name="AvoidStarImport"/>
<module name="UnusedImports"/>
<module name="RedundantImport"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck">
<property name="groups" value="java,javax,*,org.springframework"/>
<property name="ordered" value="true"/>
Expand Down

0 comments on commit 67d2635

Please sign in to comment.