From 8d6b474bf67bb8a75e8f60196f7eaf7528a85c62 Mon Sep 17 00:00:00 2001 From: Lei YU Date: Wed, 30 Aug 2023 06:47:14 +0000 Subject: Add clang-tidy-fix target Add the `clang-tidy-fix` target to apply clang-tidy fixes to the source code. This is done by calling `run-clang-tidy` with `-fix` argument. Add a test case to run `clang-tidy-fix` and verify the file is changed. Signed-off-by: Lei YU --- docs/markdown/snippets/meson_clang_tidy_fix.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/markdown/snippets/meson_clang_tidy_fix.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/meson_clang_tidy_fix.md b/docs/markdown/snippets/meson_clang_tidy_fix.md new file mode 100644 index 0000000..3a8c772 --- /dev/null +++ b/docs/markdown/snippets/meson_clang_tidy_fix.md @@ -0,0 +1,9 @@ +## clang-tidy-fix target + +If `clang-tidy` is installed and the project's source root contains a +`.clang-tidy` (or `_clang-tidy`) file, Meson will automatically define +a `clang-tidy-fix` target that runs `run-clang-tidy` tool with `-fix` +option to apply the changes found by clang-tidy to the source code. + +If you have defined your own `clang-tidy-fix` target, Meson will not +generate its own target. -- cgit v1.1