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
650
.clang-tidy
Normal file
650
.clang-tidy
Normal file
File diff suppressed because one or more lines are too long
@ -8,6 +8,8 @@ repos:
|
|||||||
- repo: https://github.com/pocc/pre-commit-hooks
|
- repo: https://github.com/pocc/pre-commit-hooks
|
||||||
rev: v1.3.4
|
rev: v1.3.4
|
||||||
hooks:
|
hooks:
|
||||||
|
- id: clang-tidy
|
||||||
|
args: ["-p", "cmake-build-debug"]
|
||||||
- id: cppcheck
|
- id: cppcheck
|
||||||
args: ["--language=c++", "--std=c++20",
|
args: ["--language=c++", "--std=c++20",
|
||||||
"--enable=warning,performance,portability,information,unusedFunction,missingInclude",
|
"--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}
|
cppch_args = --language=c++ --std=c++20 --enable=all --verbose ./*.{cpp,h}
|
||||||
cpp_flags = -DCMAKE_CXX_FLAGS=-Wall -Werror -Wextra
|
cpp_flags = -DCMAKE_CXX_FLAGS=-Wall -Werror -Wextra
|
||||||
c = cmake
|
c = cmake
|
||||||
c_args = -G Ninja -DCMAKE_BUILD_TYPE=
|
c_args = -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=
|
||||||
n = ninja
|
n = ninja
|
||||||
n_args = -C
|
n_args = -C
|
||||||
d_folder = cmake-build-debug
|
d_folder = cmake-build-debug
|
||||||
r_folder = cmake-build-release
|
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
|
v = valgrind
|
||||||
|
|
||||||
.PHONY: check build debug release valgrind test
|
.PHONY: check tidy build debug release valgrind test
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
if [ ! -d "$(d_folder)" ]; then mkdir -pv $(d_folder); fi
|
if [ ! -d "$(d_folder)" ]; then mkdir -pv $(d_folder); fi
|
||||||
@ -23,6 +25,10 @@ release:
|
|||||||
|
|
||||||
check:
|
check:
|
||||||
$(cppch) $(cppch_args)
|
$(cppch) $(cppch_args)
|
||||||
|
make tidy
|
||||||
|
|
||||||
|
tidy:
|
||||||
|
$(t) $(t_args)
|
||||||
|
|
||||||
valgrind: valgrind-debug
|
valgrind: valgrind-debug
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user