From 678d79f57788d300ffe212c23af754bbd799fd5e Mon Sep 17 00:00:00 2001 From: Jan Hensel <63857598+ja-he@users.noreply.github.com> Date: Mon, 1 Nov 2021 21:00:55 +0100 Subject: [PATCH] clang-tidy: add page (#7232) --- pages/common/clang-tidy.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/common/clang-tidy.md diff --git a/pages/common/clang-tidy.md b/pages/common/clang-tidy.md new file mode 100644 index 000000000..8655d6775 --- /dev/null +++ b/pages/common/clang-tidy.md @@ -0,0 +1,20 @@ +# clang-tidy + +> An LLVM-based C/C++ linter to find style violations, bugs and security flaws through static analysis. +> More information: . + +- Run default checks on a source file: + +`clang-tidy {{path/to/file.cpp}}` + +- Don't run any checks other than the `cppcoreguidelines` checks on a file: + +`clang-tidy {{path/to/file.cpp}} -checks={{-*,cppcoreguidelines-*}}` + +- List all available checks: + +`clang-tidy -checks={{*}} -list-checks` + +- Specify defines and includes as compilation options (after `--`): + +`clang-tidy {{path/to/file.cpp}} -- -I{{my_project/include}} -D{{definitions}}`