Skip to content

Commit c7a7e23

Browse files
committed
Updated checkstyle config to check for license headers and ignore them
when checking for duplicated code Fiexed all files which missing or invalid headers
1 parent 8326fd5 commit c7a7e23

33 files changed

+70
-81
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@
289289
<version>2.6</version>
290290
<configuration>
291291
<configLocation>${basedir}/quality_assurance/checkstyle_rules.xml</configLocation>
292+
<propertyExpansion>basedir=${basedir}</propertyExpansion>
292293
</configuration>
293294
<executions>
294295
<execution>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
4+
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
5+
6+
<suppressions>
7+
<!-- Ignore license headers: -->
8+
<suppress
9+
files=".*\.java"
10+
lines="1-15"
11+
checks="StrictDuplicateCode"/>
12+
13+
<!-- Ignore files generated by ANTLR: -->
14+
<suppress
15+
files="(FlowBuilder|FluxLexer|FluxParser)\.java"
16+
checks=".*"/>
17+
</suppressions>

quality_assurance/checkstyle_rules.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@
112112
<module name="JavadocType"/>
113113
</module>
114114
<module name="StrictDuplicateCode"/>
115+
<module name="Header">
116+
<property name="headerFile" value="${basedir}/quality_assurance/java-header.txt"/>
117+
<property name="fileExtensions" value="java"/>
118+
</module>
119+
<module name="SuppressionFilter">
120+
<property name="file" value="${basedir}/quality_assurance/checkstyle-suppressions.xml"/>
121+
</module>
115122
<module name="SuppressionCommentFilter">
116123
<property name="offCommentFormat" value="CHECKSTYLE OFF\: ([\w\|]+)"/>
117124
<property name="onCommentFormat" value="CHECKSTYLE ON\: ([\w\|]+)"/>

quality_assurance/java-header.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright 2013 Deutsche Nationalbibliothek
3+
*
4+
* Licensed under the Apache License, Version 2.0 the "License";
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/

src/main/java/org/culturegraph/mf/morph/collectors/Choose.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
*
3-
*/
41
/*
52
* Copyright 2013 Deutsche Nationalbibliothek
63
*

src/main/java/org/culturegraph/mf/morph/functions/Buffer.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
*
3-
*/
41
/*
52
* Copyright 2013 Deutsche Nationalbibliothek
63
*

src/main/java/org/culturegraph/mf/morph/functions/Count.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
*
3-
*/
41
/*
52
* Copyright 2013 Deutsche Nationalbibliothek
63
*

src/main/java/org/culturegraph/mf/morph/functions/IfNotReceived.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
*
3-
*/
41
/*
52
* Copyright 2013 Deutsche Nationalbibliothek
63
*

src/main/java/org/culturegraph/mf/morph/functions/NormalizeUTF8.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
*
3-
*/
41
/*
52
* Copyright 2013 Deutsche Nationalbibliothek
63
*

src/main/java/org/culturegraph/mf/morph/functions/Occurrence.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
*
3-
*/
41
/*
52
* Copyright 2013 Deutsche Nationalbibliothek
63
*

0 commit comments

Comments
 (0)