Revision b2f5166eea4c6ff8861464b46b7cba56e21c914c authored by Stan Jenkins on 12 July 2023, 20:56:21 UTC, committed by Stan Jenkins on 12 July 2023, 20:56:21 UTC
1 parent 41b59c8
clang-tidy
# See full list of checks here
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
tidy_base_checks=*perf*,*modernize*,*misc*,*google*,*readability*,*optin*
modern_excludes=,-modernize-replace-random-shuffle,-modernize-use-override,-modernize-concat-nested-namespaces,-modernize-avoid-c-arrays
readability_excludes=,-readability-magic-numbers,-readability-convert-member-functions-to-static,-readability-inconsistent-declaration-parameter-name,-readability-function-size,-readability-named-parameter,-readability-container-size-empty,-readability-implicit-bool-conversion,-readability-else-after-return,-readability-container-size-empty
misc_excludes=,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-misc-unused-using-decls,-misc-definitions-in-headers,-misc-unconventional-assign-operator
google_excludes=,-google-runtime-references,-google-global-names-in-headers,-google-build-using-namespace,-google-runtime-int
things_we_should_look_at=,-google-readability-casting,-google-explicit-constructor,-modernize-use-using,-modernize-pass-by-value,-readability-implicit-bool-conversion,-readability-const-return-type,-readability-avoid-const-params-in-decls,-modernize-return-braced-init-list,-modernize-use-using
tidy_checks?= $(tidy_base_checks) $(modern_excludes) $(readability_excludes) $(misc_excludes) $(google_excludes) $(things_we_should_look_at)
files?= *
folder?= ./src/test/*
.PHONY: clang-tidy
clang-tidy:
find $(folder) -path './src/test/*' -wholename '*$(files).cpp' -type f | xargs -I {} clang-tidy "{}" \
-checks='$(tidy_checks)' -format-style='file' -header-filter='./src/*' \
-- $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) $(INC_GTEST) $(CXXFLAGS_GTEST) $(CPPFLAGS)
.PHONY: clang-tidy-fix
clang-tidy-fix:
find $(folder) -path './src/test/*' -wholename '*$(files).cpp' -type f | xargs -I {} clang-tidy "{}" \
-checks='$(tidy_checks)' -format-style='file' -header-filter='./src/*' \
-fix -export-fixes="./.clang-fixes.log" \
-- $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) $(INC_GTEST) $(CXXFLAGS_GTEST) $(CPPFLAGS)
.PHONY: clang-format
clang-format:
find src -name '*.hpp' -o -name '*.cpp' | xargs -n20 -P1 clang-format -i -style=file
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...