Skip to content

Commit 710964b

Browse files
committed
Update checkstyle to 10.0 and fix various related issues
- Put checkstyle files into checkstyle/ subfolder so that the gradle task does not implicitly depend on the whole project, fixing many warnings during build and possibly increasing build performance. - Remove unused SuppressionXpathFilter from config file. - Remove outdated suppressions from suppressions file.
1 parent e29aaaf commit 710964b

3 files changed

Lines changed: 3 additions & 18 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ android {
9898
}
9999

100100
ext {
101-
checkstyleVersion = '9.3'
101+
checkstyleVersion = '10.0'
102102

103103
androidxLifecycleVersion = '2.3.1'
104104
androidxRoomVersion = '2.4.2'
@@ -121,7 +121,7 @@ configurations {
121121
}
122122

123123
checkstyle {
124-
getConfigDirectory().set(rootProject.file("."))
124+
getConfigDirectory().set(rootProject.file("checkstyle"))
125125
ignoreFailures false
126126
showViolations true
127127
toolVersion = checkstyleVersion

checkstyle.xml renamed to checkstyle/checkstyle.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
2424
<module name="SuppressionFilter">
25-
<property name="file" value="${config_loc}/checkstyle-suppressions.xml" />
25+
<property name="file" value="${config_loc}/suppressions.xml" />
2626
<property name="optional" value="true"/>
2727
</module>
2828

@@ -180,12 +180,5 @@
180180
<module name="UpperEll"/>
181181

182182
<module name="SuppressWarningsHolder" />
183-
184-
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
185-
<module name="SuppressionXpathFilter">
186-
<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
187-
default="checkstyle-xpath-suppressions.xml" />
188-
<property name="optional" value="true"/>
189-
</module>
190183
</module>
191184
</module>
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,10 @@
77
files="LocalItemListAdapter.java"
88
lines="232,304"/>
99

10-
<suppress checks="FinalParameters"
11-
files="InfoListAdapter.java"
12-
lines="253,325"/>
13-
1410
<suppress checks="EmptyBlock"
1511
files="ContentSettingsFragment.java"
1612
lines="227,245"/>
1713

18-
<suppress checks="LineLength"
19-
files="WebMWriter.java"
20-
lines="156,158"/>
21-
2214
<suppress checks="FileLength"
2315
files="Player.java"/>
2416

0 commit comments

Comments
 (0)