Get checkstyle to check Java files for AL2 headers
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 11 Jan 2011 15:00:05 +0000 (15:00 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 11 Jan 2011 15:00:05 +0000 (15:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1057681 13f79535-47bb-0310-9956-ffa450edef68

build.xml
res/checkstyle/checkstyle.xml
res/checkstyle/header-al2.txt [new file with mode: 0644]

index a9a805c..da9e4a4 100644 (file)
--- a/build.xml
+++ b/build.xml
         <exclude name="output/**"/>
         <exclude name="modules/**"/>
         <exclude name="**/*.mdl"/>
-        <!-- Exclude auto-generated files with known errors -->
-        <exclude name="java/org/apache/el/parser/ELParser.java" />
+        <!-- Exclude auto-generated files -->
+        <exclude name="java/org/apache/el/parser/ELParser*.java" />
+        <exclude name="java/org/apache/el/parser/JJTELParserState.java" />
+        <exclude name="java/org/apache/el/parser/Node.java" />
+        <exclude name="java/org/apache/el/parser/ParseException.java" />
+        <exclude name="java/org/apache/el/parser/SimpleCharStream.java" />
+        <exclude name="java/org/apache/el/parser/Token*.java" />
         <!-- Exclude these else Gump runs validate on them -->
         <exclude name="**/org/apache/tomcat/dbcp/**"/>
         <exclude name="**/tomcat-deps/**"/>
index 5204bc7..7dcea35 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
- Licensed to the Apache Software Foundation (ASF) under one or more
 Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   <!-- 'Standard Checks' in the Checkstyle documentation:                    -->
   <!-- http://checkstyle.sourceforge.net/config_coding.html                  -->
 
+  <!-- Headers -->
+  <module name="RegexpHeader">
+    <property name="headerFile" value="${basedir}/res/checkstyle/header-al2.txt"/>
+    <property name="fileExtensions" value="java"/>
+  </module>
+
   <!-- Whitespace -->
   <module name="FileTabCharacter"/>
 
diff --git a/res/checkstyle/header-al2.txt b/res/checkstyle/header-al2.txt
new file mode 100644 (file)
index 0000000..23b24ec
--- /dev/null
@@ -0,0 +1,16 @@
+^\W*$
+^\W*Licensed to the Apache Software Foundation \(ASF\) under one or more$
+^\W*contributor license agreements\.  See the NOTICE file distributed with$
+^\W*this work for additional information regarding copyright ownership\.$
+^\W*The ASF licenses this file to You under the Apache License, Version 2\.0$
+^\W*\(the "License"\); you may not use this file except in compliance with$
+^\W*the License\.  You may obtain a copy of the License at$
+^\W*$
+^\W*http://www.apache.org/licenses/LICENSE-2\.0$
+^\W*$
+^\W*Unless required by applicable law or agreed to in writing, software$
+^\W*distributed under the License is distributed on an "AS IS" BASIS,$
+^\W*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$
+^\W*See the License for the specific language governing permissions and$
+^\W*limitations under the License\.$
+^\W*$
\ No newline at end of file