Skip to content

Commit 1dd0ab0

Browse files
committed
Apply Spring checkstyle conventions
Issue gh-1624
1 parent 9219125 commit 1dd0ab0

File tree

4 files changed

+21
-65
lines changed

4 files changed

+21
-65
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
4+
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
5+
<suppressions>
6+
<suppress files=".*" checks="JavadocStyle" />
7+
<suppress files="SpringAuthorizationServerVersion\.java" checks="HideUtilityClassConstructor"/>
8+
</suppressions>

etc/checkstyle/checkstyle.xml

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,18 @@
11
<?xml version="1.0"?>
2-
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
3-
"https://www.puppycrawl.com/dtds/configuration_1_3.dtd">
4-
<module name="Checker">
5-
<!-- Suppressions -->
2+
<!DOCTYPE module PUBLIC
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
5+
<module name="com.puppycrawl.tools.checkstyle.Checker">
66
<module name="SuppressionFilter">
7-
<property name="file" value="${config_loc}/suppressions.xml"/>
7+
<property name="file"
8+
value="${config_loc}/checkstyle-suppressions.xml" />
89
</module>
9-
10-
<!-- Root Checks -->
11-
<module name="RegexpHeader">
12-
<property name="headerFile" value="${config_loc}/header.txt"/>
13-
<property name="fileExtensions" value="java"/>
10+
<module name="com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck">
11+
<property name="headerFile" value="${config_loc}/header.txt" />
12+
<property name="fileExtensions" value="java" />
1413
</module>
15-
16-
<!-- Root Checks -->
17-
<module name="TreeWalker">
18-
<!-- Annotations -->
19-
<module name="MissingOverrideCheck" />
20-
21-
<!-- Coding -->
22-
<module name="EmptyStatementCheck" />
23-
<module name="RedundantModifier" />
24-
25-
<!-- Imports -->
26-
<module name="UnusedImportsCheck">
27-
<property name="processJavadoc" value="true" />
28-
</module>
29-
30-
<!-- Regexp -->
31-
<module name="RegexpSinglelineJava">
32-
<property name="format" value="^\t* +\t*\S"/>
33-
<property name="message" value="Line has leading space characters; indentation should be performed with tabs only."/>
34-
<property name="ignoreComments" value="true"/>
35-
</module>
36-
<module name="RegexpSinglelineJava">
37-
<property name="maximum" value="0"/>
38-
<property name="format" value="org\.junit\.Assert\.assert"/>
39-
<property name="message" value="Please use AssertJ imports."/>
40-
<property name="ignoreComments" value="true"/>
41-
</module>
42-
<module name="Regexp">
43-
<property name="format" value="[ \t]+$"/>
44-
<property name="illegalPattern" value="true"/>
45-
<property name="message" value="Trailing whitespace"/>
46-
</module>
47-
48-
<!-- Whitespace -->
49-
<module name="WhitespaceAfterCheck" />
14+
<module name="io.spring.javaformat.checkstyle.SpringChecks">
15+
<property name="excludes" value="io.spring.javaformat.checkstyle.check.SpringHeaderCheck" />
16+
<property name="excludes" value="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck" />
5017
</module>
5118
</module>

etc/checkstyle/header.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
^\Q/*\E$
2-
^\Q * Copyright\E (\d{4}(\-\d{4})? the original author or authors\.|(\d{4}, )*(\d{4}) Acegi Technology Pty Limited)$
2+
^\Q * Copyright \E20\d\d\-20\d\d\Q the original author or authors.\E$
33
^\Q *\E$
44
^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$
55
^\Q * you may not use this file except in compliance with the License.\E$

etc/checkstyle/suppressions.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)