diff options
Diffstat (limited to 'lib/sanitizer_common/scripts/check_lint.sh')
-rwxr-xr-x | lib/sanitizer_common/scripts/check_lint.sh | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/lib/sanitizer_common/scripts/check_lint.sh b/lib/sanitizer_common/scripts/check_lint.sh index e65794df0ce7f..3240f6f18ceef 100755 --- a/lib/sanitizer_common/scripts/check_lint.sh +++ b/lib/sanitizer_common/scripts/check_lint.sh @@ -13,20 +13,27 @@ fi # Cpplint setup cd ${SCRIPT_DIR} if [ ! -d cpplint ]; then - svn co -r83 http://google-styleguide.googlecode.com/svn/trunk/cpplint cpplint + svn co http://google-styleguide.googlecode.com/svn/trunk/cpplint cpplint +else + (cd cpplint && svn up) fi CPPLINT=${SCRIPT_DIR}/cpplint/cpplint.py # Filters # TODO: remove some of these filters -ASAN_RTL_LINT_FILTER=-readability/casting,-readability/check,-build/include,-build/header_guard,-build/class,-legal/copyright,-build/namespaces -ASAN_TEST_LINT_FILTER=-readability/casting,-build/include,-legal/copyright,-whitespace/newline,-runtime/sizeof,-runtime/int,-runtime/printf,-build/header_guard +COMMON_LINT_FILTER=-build/include,-build/header_guard,-legal/copyright,-whitespace/comments,-readability/casting,\ +-build/namespaces +ASAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int +ASAN_TEST_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/sizeof,-runtime/int,-runtime/printf ASAN_LIT_TEST_LINT_FILTER=${ASAN_TEST_LINT_FILTER},-whitespace/line_length -TSAN_RTL_LINT_FILTER=-legal/copyright,-build/include,-readability/casting,-build/header_guard,-build/namespaces +TSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER} TSAN_TEST_LINT_FILTER=${TSAN_RTL_LINT_FILTER},-runtime/threadsafe_fn,-runtime/int TSAN_LIT_TEST_LINT_FILTER=${TSAN_TEST_LINT_FILTER},-whitespace/line_length -MSAN_RTL_LINT_FILTER=-legal/copyright,-build/include,-readability/casting,-build/header_guard,-build/namespaces -TSAN_RTL_INC_LINT_FILTER=${TSAN_TEST_LINT_FILTER},-runtime/sizeof +MSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER} +LSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER} +LSAN_LIT_TEST_LINT_FILTER=${LSAN_RTL_LINT_FILTER},-whitespace/line_length +COMMON_RTL_INC_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int,-runtime/sizeof,-runtime/printf +SANITIZER_INCLUDES_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int cd ${LLVM_CHECKOUT} @@ -40,12 +47,12 @@ COMPILER_RT=projects/compiler-rt # Headers SANITIZER_INCLUDES=${COMPILER_RT}/include/sanitizer -${CPPLINT} --filter=${TSAN_RTL_LINT_FILTER} ${SANITIZER_INCLUDES}/*.h +${CPPLINT} --filter=${SANITIZER_INCLUDES_LINT_FILTER} ${SANITIZER_INCLUDES}/*.h # Sanitizer_common COMMON_RTL=${COMPILER_RT}/lib/sanitizer_common -${CPPLINT} --filter=${ASAN_RTL_LINT_FILTER} ${COMMON_RTL}/*.{cc,h} -${CPPLINT} --filter=${TSAN_RTL_LINT_FILTER} ${COMMON_RTL}/tests/*.cc +${CPPLINT} --filter=${COMMON_RTL_INC_LINT_FILTER} ${COMMON_RTL}/*.{cc,h} +${CPPLINT} --filter=${COMMON_RTL_INC_LINT_FILTER} ${COMMON_RTL}/tests/*.cc # Interception INTERCEPTION=${COMPILER_RT}/lib/interception @@ -69,6 +76,12 @@ ${CPPLINT} --filter=${TSAN_LIT_TEST_LINT_FILTER} ${TSAN_RTL}/lit_tests/*.cc MSAN_RTL=${COMPILER_RT}/lib/msan ${CPPLINT} --filter=${MSAN_RTL_LINT_FILTER} ${MSAN_RTL}/*.{cc,h} +# LSan +LSAN_RTL=${COMPILER_RT}/lib/lsan +${CPPLINT} --filter=${LSAN_RTL_LINT_FILTER} ${LSAN_RTL}/*.{cc,h} +${CPPLINT} --filter=${LSAN_RTL_LINT_FILTER} ${LSAN_RTL}/tests/*.{cc,h} +${CPPLINT} --filter=${LSAN_LIT_TEST_LINT_FILTER} ${LSAN_RTL}/lit_tests/*.{cc,h} + set +e # Misc files @@ -77,6 +90,6 @@ for FILE in $FILES; do TMPFILE=$(mktemp -u ${FILE}.XXXXX).cc echo "Checking $FILE" cp -f $FILE $TMPFILE && \ - ${CPPLINT} --filter=${TSAN_RTL_INC_LINT_FILTER} $TMPFILE + ${CPPLINT} --filter=${COMMON_RTL_INC_LINT_FILTER} $TMPFILE rm $TMPFILE done |