git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[GSoC] [PATCH] travis-ci: added clang static analysis

From
SSiddharthaMishra <sidm1999@gmail.com>
Date
Mar 5, 2018, 20:04 UTC
Message-ID
<20180305200400.3769-1-sidm1999@gmail.com>
Added a job to run clang static code analysis on the master and maint branch
Signed-off-by: SiddharthaMishra <sidm1999@gmail.com>
---
 .travis.yml               | 17 ++++++++++++++++-
 ci/run-static-analysis.sh |  9 ++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 4684b3f4f..9b891d182 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -48,7 +48,7 @@ matrix:
       before_install:
       before_script:
       script: ci/run-linux32-docker.sh
-    - env: jobname=StaticAnalysis
+    - env: jobname=CocciStaticAnalysis
       os: linux
       compiler:
       addons:
@@ -59,6 +59,21 @@ matrix:
       before_script:
       script: ci/run-static-analysis.sh
       after_failure:
+    - if: branch IN (master, maint)
+      env: jobname=ClangStaticAnalysis
+      os: linux
+      compiler:
+      add_ons:
+        apt:
+          sources:
+          - ubuntu-toolchain-r-test
+          - llvm-toolchain-trusty
+          packages:
+          - clang
+      before_install:
+      before_script:
+      script: ci/run-static-analysis.sh
+      after_failure:
     - env: jobname=Documentation
       os: linux
       compiler:
diff --git a/ci/run-static-analysis.sh b/ci/run-static-analysis.sh
index fe4ee4e06..6ae032f54 100755
--- a/ci/run-static-analysis.sh
+++ b/ci/run-static-analysis.sh
@@ -5,6 +5,13 @@
 
 . ${0%/*}/lib-travisci.sh
 
-make coccicheck
+case "$jobname" in
+ClangStaticAnalysis)
+	scan-build -analyze-headers --status-bugs make
+	;;
+CocciStaticAnalysis)
+	make coccicheck
+	;;
+esac
 
 save_good_tree
-- 
2.16.2.248.ge2408a6f7.dirty
Next: Junio C Hamano
Message 1 of 9 in “travis-ci: added clang static analysis”
  1. SiddharthaMishraMar 5, 2018
  2. Junio C HamanoMar 6, 2018
  3. Siddhartha MishraMar 6, 2018
  4. Johannes SchindelinMar 7, 2018
  5. Lars SchneiderMar 12, 2018
  6. Siddhartha MishraMar 13, 2018
  7. Siddhartha MishraMar 13, 2018
  8. Lars SchneiderApr 1, 2018
  9. Siddhartha MishraApr 2, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.