chore: integrate cppcheck into workflow

This commit is contained in:
Jef Roosens 2023-11-14 10:49:12 +01:00
parent b053aa6c93
commit 6af3e6ad6d
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
17 changed files with 64 additions and 69 deletions

View file

@ -43,7 +43,6 @@ libtrie:
liblsm:
$(MAKE) -C lsm
.PHONY: $(BIN)
$(BIN): libtrie liblsm $(OBJS)
$(CC) -o $@ $(OBJS) $(_LDFLAGS)
@ -55,6 +54,12 @@ $(BUILD_DIR)/$(THIRDPARTY_DIR)/%.c.o: $(THIRDPARTY_DIR)/%.c
mkdir -p $(dir $@)
$(CC) $(_CFLAGS) -c $< -o $@
.PHONY: bin-docker
bin-docker:
docker build -t lander .
docker container create --name lander-temp lander
docker cp -q lander-temp:/bin/lander $(BUILD_DIR)/lander-docker
docker container rm lander-temp
# =====TESTING=====
.PHONY: run
@ -110,6 +115,19 @@ lint:
fmt:
clang-format -i $(SRCS) $(SRCS_H) $(SRCS_H_INTERNAL)
.PHONY: check
check:
mkdir -p $(BUILD_DIR)/cppcheck
cppcheck \
$(addprefix -I,$(INC_DIRS)) \
--cppcheck-build-dir=$(BUILD_DIR)/cppcheck \
--project=compile_commands.json \
--error-exitcode=1 \
--enable=warning,style \
-ithirdparty/* \
-itrie/* \
--quiet
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)