makefile,pre-commit: add clang-tidy
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
519919326e
commit
ec0691fba1
File diff suppressed because one or more lines are too long
|
@ -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",
|
||||
|
|
10
Makefile
10
Makefile
|
@ -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
|
||||
|
||||
|
|
Reference in New Issue