You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bb...@apache.org on 2018/12/12 19:50:25 UTC

[geode-native] branch develop updated: GEODE-6139: Enforce Apache Rat findings in Travis CI (#414)

This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new f89a3d5  GEODE-6139: Enforce Apache Rat findings in Travis CI (#414)
f89a3d5 is described below

commit f89a3d59a18f616cdc51b5df94be8fd2490444df
Author: Blake Bender <ek...@hotmail.com>
AuthorDate: Wed Dec 12 11:50:21 2018 -0800

    GEODE-6139: Enforce Apache Rat findings in Travis CI (#414)
    
    * GEODE-6139: Fix problems reported by rat in source release
    - Add missing license headers to a couple of files
    - Fix bad line for '.vs' in .gitignore
    - Tell rat to ignore some trivial config files
    - Remove stray tmp file
    - Fix cmake file that was badly reformatted
    - Fix .cpackignore string.  .gitignore files use globbing, not regex, so they can't be read into cpack ignore directly
    - Run a script to execute rat and parse the result, rather than execute directly from Travis, so we can fail the build if rat reports issues
    
    Co-authored-by: Ernest Burghardt <eb...@pivotal.io>
    Co-authored-by: Mike Martell <mm...@pivotal.io>
    Co-authored-by: Jacob Barrett <jb...@pivotal.io>
---
 .ratCheck.sh | 12 ++++++++++++
 .ratignore   |  2 ++
 .travis.yml  |  2 +-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/.ratCheck.sh b/.ratCheck.sh
new file mode 100755
index 0000000..0fb3474
--- /dev/null
+++ b/.ratCheck.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+SOURCE_DIR=.
+COUNT=`java -jar /apache-rat-0.12/apache-rat-0.12.jar -E ${SOURCE_DIR}/.ratignore -d ${SOURCE_DIR} | grep '== File:' | sed 's/== File://' | wc -l`
+
+if [ $COUNT -gt 0 ]
+    then
+        echo "Rat check failed, $COUNT files are missing Apache license headers"
+fi
+
+exit $COUNT
+
diff --git a/.ratignore b/.ratignore
index 0f9c4ba..fefd090 100644
--- a/.ratignore
+++ b/.ratignore
@@ -5,6 +5,8 @@
 .*\.gitignore$
 .*\.lcovrc$
 .*\.ratignore$
+.*\.lgtm.yml$
+.*\.ratCheck.sh$
 
 .*md$
 .*json$
diff --git a/.travis.yml b/.travis.yml
index d61ddab..826c049 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,7 +29,7 @@ env:
     - SOURCE_DIR="/geode-native"
 
   matrix:
-    - DOCKER_COMMAND="java -jar /apache-rat-0.12/apache-rat-0.12.jar -E ${SOURCE_DIR}/.ratignore -d ${SOURCE_DIR}"
+    - DOCKER_COMMAND="cd ${SOURCE_DIR} && ./.ratCheck.sh"
     - DOCKER_COMMAND="mkdir build && cd build && cmake ${SOURCE_DIR} -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DCMAKE_CXX_CLANG_TIDY=clang-tidy && cmake --build . -- -j2 && ./cppcache/test/apache-geode_unittests && git -C ${SOURCE_DIR} diff --exit-code"
 
 install: