Skip to content

Commit

Permalink
GH-1322: Add Checkstyle rule to ensure Java files get right header
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Oct 13, 2022
1 parent 8cf38b3 commit 45cbe1b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eclipse/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
<module name="UnusedLocalVariable"/>
</module>

<module name="RegexpHeader">
<property name="headerFile" value="./eclipse/java.header"/>
<property name="multiLines" value="2, 3, 14"/>
<property name="fileExtensions" value="java"/>
</module>

<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="No trailing white space allowed."/>
Expand Down
15 changes: 15 additions & 0 deletions eclipse/java.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
^/\*+$
^ \* Copyright \(c\) \d\d\d\d(-\d\d\d\d)? .+\.$
^ \*$
^ \* All rights reserved\. This program and the accompanying materials$
^ \* are made available under the terms of the Eclipse Public License v2\.0$
^ \* and Eclipse Distribution License v1\.0 which accompany this distribution\.$
^ \*$
^ \* The Eclipse Public License is available at$
^ \* http://www\.eclipse\.org/legal/epl-v20\.html$
^ \* and the Eclipse Distribution License is available at$
^ \* http://www\.eclipse\.org/org/documents/edl-v10\.html\.$
^ \*$
^ \* Contributors:$
^ \* .+$
^ \*+/$
6 changes: 6 additions & 0 deletions leshan-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ Contributors:

<build>
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<excludes>org/eclipse/leshan/core/util/Base64.java,org/eclipse/leshan/core/util/BaseNCodec.java,org/eclipse/leshan/core/util/Hex.java,org/eclipse/leshan/core/util/RandomStringUtils.java,org/eclipse/leshan/core/util/StringUtils.java,org/eclipse/leshan/core/util/Validate.java,org/eclipse/leshan/core/util/datatype/ULong.java</excludes>
</configuration>
</plugin>
<plugin>
<!-- Create test-jar to reuse it in integration-tests -->
<artifactId>maven-jar-plugin</artifactId>
Expand Down

0 comments on commit 45cbe1b

Please sign in to comment.