Skip to content

Commit 03877f7

Browse files
committed
Upgrade to checkstyle 8.21
Closes gh-113
1 parent 1228c7e commit 03877f7

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

pom.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<ant-contrib.version>1.0b3</ant-contrib.version>
3939
<asm.version>5.2</asm.version>
4040
<assertj.version>3.8.0</assertj.version>
41+
<checkstyle.version>8.21</checkstyle.version>
4142
<gradle.version>3.4</gradle.version>
4243
<groovy.version>2.4.7</groovy.version>
4344
<maven-core.version>3.5.0</maven-core.version>
@@ -86,7 +87,7 @@
8687
<dependency>
8788
<groupId>com.puppycrawl.tools</groupId>
8889
<artifactId>checkstyle</artifactId>
89-
<version>8.21</version>
90+
<version>${checkstyle.version}</version>
9091
</dependency>
9192
</dependencies>
9293
</plugin>
@@ -472,7 +473,7 @@
472473
<dependency>
473474
<groupId>com.puppycrawl.tools</groupId>
474475
<artifactId>checkstyle</artifactId>
475-
<version>8.18</version>
476+
<version>${checkstyle.version}</version>
476477
</dependency>
477478
<dependency>
478479
<groupId>net.sf.trove4j</groupId>

spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/SpringChecks.java

+1-13
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747
*/
4848
public class SpringChecks extends AbstractFileSetCheck implements ExternalResourceHolder {
4949

50-
private static final int DEFAULT_TAB_WIDTH = 8;
51-
52-
private int tabWidth = DEFAULT_TAB_WIDTH;
53-
5450
private ClassLoader classLoader;
5551

5652
private ModuleFactory moduleFactory;
@@ -65,14 +61,6 @@ public class SpringChecks extends AbstractFileSetCheck implements ExternalResour
6561

6662
private String projectRootPackage = SpringImportOrderCheck.DEFAULT_PROJECT_ROOT_PACKAGE;
6763

68-
/**
69-
* Sets tab width.
70-
* @param tabWidth the distance between tab stops
71-
*/
72-
public void setTabWidth(int tabWidth) {
73-
this.tabWidth = tabWidth;
74-
}
75-
7664
/**
7765
* Sets classLoader to load class.
7866
* @param classLoader class loader to resolve classes with.
@@ -94,7 +82,7 @@ public void finishLocalSetup() {
9482
DefaultContext context = new DefaultContext();
9583
context.add("classLoader", this.classLoader);
9684
context.add("severity", getSeverity());
97-
context.add("tabWidth", String.valueOf(this.tabWidth));
85+
context.add("tabWidth", String.valueOf(getTabWidth()));
9886
context.add("moduleFactory", this.moduleFactory);
9987
Properties properties = new Properties();
10088
put(properties, "headerType", this.headerType);

0 commit comments

Comments
 (0)