[tidy] Install mason clang-tidy if CLANG_TIDY is not set
Also added HeaderFilterRegex to .clang-tidy.
This commit is contained in:
@@ -1 +1,2 @@
|
||||
Checks: 'modernize-*,misc-static-assert,llvm-namespace-comment,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-core.uninitialized.UndefReturn'
|
||||
HeaderFilterRegex: 'mbgl'
|
||||
|
||||
2
Makefile
2
Makefile
@@ -306,10 +306,12 @@ compdb-macos: platform/macos/platform.gyp $(MACOS_OUTPUT_PATH)/config.gypi
|
||||
tidy: compdb tidy-$(HOST_PLATFORM)
|
||||
|
||||
tidy-linux:
|
||||
if test -z $(CLANG_TIDY); then .mason/mason install clang-tidy 3.8; fi
|
||||
deps/ninja/ninja-linux -C $(LINUX_OUTPUT_PATH)/$(BUILDTYPE) headers
|
||||
scripts/clang-tidy.sh $(LINUX_OUTPUT_PATH)/$(BUILDTYPE)
|
||||
|
||||
tidy-macos:
|
||||
if test -z $(CLANG_TIDY); then .mason/mason install clang-tidy 3.8; fi
|
||||
deps/ninja/ninja-macos -C $(MACOS_OUTPUT_PATH)/$(BUILDTYPE) headers
|
||||
scripts/clang-tidy.sh $(MACOS_OUTPUT_PATH)/$(BUILDTYPE)
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ workflows:
|
||||
set -eu -o pipefail
|
||||
export BUILDTYPE=Release
|
||||
make compdb
|
||||
.mason/mason install clang-tidy 3.8
|
||||
make tidy
|
||||
- is_debug: 'no'
|
||||
- slack:
|
||||
|
||||
@@ -18,7 +18,7 @@ command -v ${CLANG_TIDY} >/dev/null 2>&1 || {
|
||||
cd $1
|
||||
|
||||
function check_tidy() {
|
||||
OUTPUT=$(${CLANG_TIDY} $0 -p=. -header-filter='mbgl' 2>/dev/null)
|
||||
OUTPUT=$(${CLANG_TIDY} -p=$PWD $0 2>/dev/null)
|
||||
if [[ -n $OUTPUT ]]; then
|
||||
echo "Error: A clang-tidy warning/error happened:"
|
||||
echo -e "$OUTPUT"
|
||||
|
||||
Reference in New Issue
Block a user