nemo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From taegeo...@apache.org
Subject [incubator-nemo] branch master updated: [NEMO-306] Add license checkstyle (#171)
Date Mon, 03 Dec 2018 08:25:56 GMT
This is an automated email from the ASF dual-hosted git repository.

taegeonum pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nemo.git


The following commit(s) were added to refs/heads/master by this push:
     new b417cdb  [NEMO-306] Add license checkstyle (#171)
b417cdb is described below

commit b417cdbfaa7a3509c76bac2f60e69f9abaf4cb07
Author: jooykim <jooykim00@gmail.com>
AuthorDate: Mon Dec 3 17:25:52 2018 +0900

    [NEMO-306] Add license checkstyle (#171)
    
    JIRA: [NEMO-306: Apache License Checkstyle](https://issues.apache.org/jira/projects/NEMO/issues/NEMO-306)
    
    **Major changes:**
    - Adds a checkstyle rule to check Apache license headers
    
    **Minor changes to note:**
    - N/A
    
    **Tests for the changes:**
    - N/A
    
    **Other comments:**
    - N/A
---
 checkstyle.license | 18 ++++++++++++++++++
 checkstyle.xml     |  6 +++++-
 formatter.xml      | 18 ++++++++++++++++++
 pom.xml            |  1 +
 4 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/checkstyle.license b/checkstyle.license
new file mode 100644
index 0000000..5d89b37
--- /dev/null
+++ b/checkstyle.license
@@ -0,0 +1,18 @@
+(\s*[/\*|\/\/|<!--|#]+\s*)
+((\s*[\*|\/\/|#]*\s*)Licensed to the Apache Software Foundation \(ASF\) under one)
+((\s*[\*|\/\/|#]*\s*)or more contributor license agreements.  See the NOTICE file)
+((\s*[\*|\/\/|#]*\s*)distributed with this work for additional information)
+((\s*[\*|\/\/|#]*\s*)regarding copyright ownership.  The ASF licenses this file)
+((\s*[\*|\/\/|#]*\s*)to you under the Apache License, Version 2.0 \(the)
+((\s*[\*|\/\/|#]*\s*)"License"\); you may not use this file except in compliance)
+((\s*[\*|\/\/|#]*\s*)with the License.  You may obtain a copy of the License at)
+(\s*[\*|\/\/|#]*\s*)
+((\s*[\*|\/\/|#]*\s*)http:\/\/www.apache.org\/licenses\/LICENSE-2.0)
+(\s*[\*|\/\/|#]*\s*)
+((\s*[\*|\/\/|#]*\s*)Unless required by applicable law or agreed to in writing,)
+((\s*[\*|\/\/|#]*\s*)software distributed under the License is distributed on an)
+((\s*[\*|\/\/|#]*\s*)"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY)
+((\s*[\*|\/\/|#]*\s*)KIND, either express or implied.  See the License for the)
+((\s*[\*|\/\/|#]*\s*)specific language governing permissions and limitations)
+((\s*[\*|\/\/|#]*\s*)under the License.)
+(\s*[\*\/|\/\/|\-\->|#]+\s*)
diff --git a/checkstyle.xml b/checkstyle.xml
index 3d52af6..c7f8761 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -169,7 +169,7 @@ under the License.
         <module name="InterfaceIsType"/>
         <module name="VisibilityModifier"/>
 
-      <!-- Miscellaneous other checks.                   -->
+        <!-- Miscellaneous other checks.                   -->
         <!-- See http://checkstyle.sf.net/config_misc.html -->
         <module name="ArrayTypeStyle"/>
         <module name="FinalParameters"/>
@@ -178,4 +178,8 @@ under the License.
 
         <module name="SuppressWarningsHolder" />
     </module>
+
+    <module name="RegexpHeader">
+      <property name="headerFile" value="${checkstyle.header.file}" />
+    </module>
 </module>
diff --git a/formatter.xml b/formatter.xml
index 489d8a6..598fc3d 100644
--- a/formatter.xml
+++ b/formatter.xml
@@ -1,4 +1,22 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+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 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
 <profiles version="14">
 <profile kind="CodeFormatterProfile" name="nemo" version="14">
 <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
diff --git a/pom.xml b/pom.xml
index 132c5b0..768ade9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -190,6 +190,7 @@ under the License.
                         <phase>validate</phase>
                         <configuration>
                             <configLocation>checkstyle.xml</configLocation>
+                            <headerLocation>checkstyle.license</headerLocation>
                             <encoding>UTF-8</encoding>
                             <consoleOutput>true</consoleOutput>
                             <failsOnError>true</failsOnError>


Mime
View raw message