mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 00:29:46 +01:00
makefiles/clang-tidy: initial support
This commit is contained in:
parent
d59db60820
commit
2c18d0d3d6
@ -833,6 +833,8 @@ objdump:
|
||||
$(call check_cmd,$(OBJDUMP),Objdump program)
|
||||
$(OBJDUMP) $(OBJDUMPFLAGS) $(ELFFILE) | less
|
||||
|
||||
# inlcude clang-tidy
|
||||
include $(RIOTMAKE)/clang_tidy.inc.mk
|
||||
# Support Eclipse IDE.
|
||||
include $(RIOTMAKE)/eclipse.inc.mk
|
||||
|
||||
|
18
makefiles/clang_tidy.inc.mk
Normal file
18
makefiles/clang_tidy.inc.mk
Normal file
@ -0,0 +1,18 @@
|
||||
.PHONY: clang-tidy
|
||||
|
||||
ifneq (, $(filter clang-tidy,$(MAKECMDGOALS)))
|
||||
ifneq (llvm,$(TOOLCHAIN))
|
||||
$(error clang-tidy must be ran with TOOLCHAIN=llvm)
|
||||
endif
|
||||
endif
|
||||
|
||||
FILE_REFEX = '.([CcHh]|[ch]pp)$$'
|
||||
DIFF_FILTER ?= 'ACMR'
|
||||
BASE_BRANCH ?= master
|
||||
|
||||
CLANG_TIDY_CHECKS ?= *
|
||||
CLANG_TIDY_SRCS ?= $(shell git diff --diff-filter=$(DIFF_FILTER) --name-only $(BASE_BRANCH) | grep -E $(FILE_REFEX))
|
||||
|
||||
clang-tidy:
|
||||
$(Q)cd $(RIOTBASE); \
|
||||
clang-tidy -checks=$(CLANG_TIDY_CHECKS) $(CLANG_TIDY_SRCS) -- $(CFLAGS) $(INCLUDES)
|
Loading…
Reference in New Issue
Block a user