소스 검색

add script .ci/clang-tidy.sh

Karel Miko 7 년 전
부모
커밋
ed2ec2e3ed
1개의 변경된 파일51개의 추가작업 그리고 0개의 파일을 삭제
  1. 51 0
      .ci/clang-tidy.sh

+ 51 - 0
.ci/clang-tidy.sh

@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# output version
+bash .ci/printinfo.sh
+
+# tested with clang-tidy from llvm-6.0.0
+# not tested with Travis-CI
+
+#### we use the main test sets:
+# readability
+# misc
+# clang-analyzer
+# google
+# performance
+# modernize
+# cert
+# bugprone
+# portability
+
+#### the following checks are skipped
+# google-readability-function-size
+# readability-function-size
+# google-readability-casting
+# readability-braces-around-statements
+# misc-macro-parentheses
+# clang-analyzer-valist.Uninitialized
+
+echo "Run clang-tidy version"
+
+clang-tidy --version || exit 1
+
+echo "Run clang-tidy..."
+
+clang-tidy src/*/*.c src/*/*/*.c src/*/*/*/*.c src/*/*/*/*/*.c -warnings-as-errors='*' --quiet --checks=-*,\
+readability-*,-readability-function-size,-readability-braces-around-statements,\
+misc-*,-misc-macro-parentheses,\
+clang-analyzer-*,-clang-analyzer-valist.Uninitialized,\
+google-*,-google-readability-function-size,-google-readability-casting,\
+performance-*,\
+modernize-*,\
+cert-*,\
+bugprone-*,\
+portability-* -- -DUSE_LTM -DLTM_DESC -Isrc/headers -I../libtommath || { echo "clang-tidy FAILED!"; exit 1; }
+
+echo "clang-tidy ok"
+
+exit 0
+
+# ref:         $Format:%D$
+# git commit:  $Format:%H$
+# commit time: $Format:%ai$