Skip to content

Commit 3df50f9

Browse files
committed
Have checkstyle check file header.
Also move checkstyle config to a separate directory and file.
1 parent 0a493aa commit 3df50f9

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

checkstyle/checkstyle-config.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
3+
<module name="Checker">
4+
<module name="TreeWalker">
5+
<module name="AvoidStarImport"/>
6+
<module name="NeedBraces"/>
7+
</module>
8+
<module name="RegexpHeader">
9+
<property name="headerFile" value="checkstyle/header.template.txt"/>
10+
<property name="fileExtensions" value="java"/>
11+
</module>
12+
</module>

checkstyle/header.template.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// SPDX-License-Identifier: BSD-2-Clause

pom.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,10 @@
248248
Still too many failure (mostly in Javadoc) to enable it fully:
249249
<configLocation>google_checks.xml</configLocation>
250250
-->
251+
<configLocation>checkstyle/checkstyle-config.xml</configLocation>
251252
<linkXRef>false</linkXRef>
252253
<consoleOutput>true</consoleOutput>
253254
<failsOnError>true</failsOnError>
254-
<checkstyleRules>
255-
<module name="Checker">
256-
<module name="TreeWalker">
257-
<module name="AvoidStarImport"/>
258-
<module name="NeedBraces"/>
259-
</module>
260-
</module>
261-
</checkstyleRules>
262255
</configuration>
263256
<dependencies>
264257
<dependency>

0 commit comments

Comments
 (0)