summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-17 22:37:34 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-17 22:37:34 +0300
commit53530f76275df76406a9ce438a33df78c50d0948 (patch)
tree888d1a117177a6c3dfaf0b64d71375391f28d91a
parentb20d8092a8b34f852351d7345951318a218e38c0 (diff)
downloadmv-53530f76275df76406a9ce438a33df78c50d0948.tar.gz
mv-53530f76275df76406a9ce438a33df78c50d0948.tar.bz2
mv-53530f76275df76406a9ce438a33df78c50d0948.tar.xz
mv-53530f76275df76406a9ce438a33df78c50d0948.zip
Add cpplint into ci scripts.
Enable only rules what not giving false positives.
-rw-r--r--.gitlab-ci.yml6
-rwxr-xr-xtools/ci/jobs/cpplint.sh50
2 files changed, 56 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d7bc7be07..c109faabc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -350,6 +350,12 @@ mplint_data:
- ./tools/ci/jobs/mplint.sh data
image: debian:unstable
+cpplint:
+ stage: test
+ script:
+ - ./tools/ci/jobs/cpplint.sh
+ image: debian:unstable
+
# reports
success:
diff --git a/tools/ci/jobs/cpplint.sh b/tools/ci/jobs/cpplint.sh
new file mode 100755
index 000000000..3824efe9d
--- /dev/null
+++ b/tools/ci/jobs/cpplint.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+export LOGFILE=cpplint.log
+
+source ./tools/ci/scripts/init.sh
+
+aptget_install python wget
+
+rm cpplint.py
+wget "https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py"
+chmod +x cpplint.py
+
+CHECKER="./cpplint.py --filter=\
+-build/include,\
+-whitespace/braces,-whitespace/operators,-runtime/references,\
+-runtime/threadsafe_fn,-readability/streams,\
+-runtime/rtti,\
+-whitespace/newline,-whitespace/labels,\
+-runtime/indentation_namespace,\
+-whitespace/indent,\
+-whitespace/parens,\
+-runtime/int,\
+-readability/todo,\
+-runtime/arrays,\
+-runtime/printf,\
+-whitespace/empty_loop_body,\
+-build/c++11,\
+-readability/fn_size,\
+-build/header_guard,\
+-readability/braces,\
+-legal/copyright,\
+-whitespace/semicolon,\
+-readability/namespace,\
+-readability/casting"
+
+find src -type f -name "*.cpp" -exec $CHECKER {} \; 2>${ERRFILE}2
+find src -type f -name "*.hpp" -exec $CHECKER {} \; 2>>${ERRFILE}2
+find src -type f -name "*.h" -exec $CHECKER {} \; 2>>${ERRFILE}2
+find src -type f -name "*.cc" -exec $CHECKER {} \; 2>>${ERRFILE}2
+
+grep ": " ${ERRFILE}2 | \
+grep -v "debug_new" | \
+grep -v "sdl2gfx/SDL2" \
+>${ERRFILE}
+
+rm ${ERRFILE}2
+
+run_check_warnings
+
+echo ok