makefile,pre-commit: add clang-tidy
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2021-10-30 20:20:30 +02:00
parent 519919326e
commit ec0691fba1
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
3 changed files with 660 additions and 2 deletions

650
.clang-tidy Normal file

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,8 @@ repos:
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.4
hooks:
- id: clang-tidy
args: ["-p", "cmake-build-debug"]
- id: cppcheck
args: ["--language=c++", "--std=c++20",
"--enable=warning,performance,portability,information,unusedFunction,missingInclude",

View File

@ -2,14 +2,16 @@ cppch = cppcheck
cppch_args = --language=c++ --std=c++20 --enable=all --verbose ./*.{cpp,h}
cpp_flags = -DCMAKE_CXX_FLAGS=-Wall -Werror -Wextra
c = cmake
c_args = -G Ninja -DCMAKE_BUILD_TYPE=
c_args = -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=
n = ninja
n_args = -C
d_folder = cmake-build-debug
r_folder = cmake-build-release
t = clang-tidy
t_args = --config="" --format-style=google --checks="clang-diagnostic-*,clang-analyzer-*,google-*" --use-color=true -p $(d_folder) ./*.{cpp,h}
v = valgrind
.PHONY: check build debug release valgrind test
.PHONY: check tidy build debug release valgrind test
debug:
if [ ! -d "$(d_folder)" ]; then mkdir -pv $(d_folder); fi
@ -23,6 +25,10 @@ release:
check:
$(cppch) $(cppch_args)
make tidy
tidy:
$(t) $(t_args)
valgrind: valgrind-debug