@@ -2,14 +2,19 @@ version: "3"
2
2
3
3
tasks :
4
4
cpp-check :
5
+ desc : " Runs the C++ linters."
5
6
cmds :
6
7
- task : " cpp-format-check"
8
+ - task : " cpp-static-check"
7
9
8
10
cpp-fix :
11
+ desc : " Runs the C++ linters to fix all formatting issues and perform static code analysis. "
9
12
cmds :
10
13
- task : " cpp-format-fix"
14
+ - task : " cpp-static-fix"
11
15
12
16
cpp-format-check :
17
+ desc : " Runs the C++ linters that identify formatting issues."
13
18
sources : &cpp_format_src_files
14
19
- " {{.ROOT_DIR}}/**/*.cpp"
15
20
- " {{.ROOT_DIR}}/**/*.h"
30
35
VENV_DIR : " {{.G_LINT_VENV_DIR}}"
31
36
32
37
cpp-format-fix :
38
+ desc : " Runs the C++ linters and fixes all formatting issues."
39
+ sources : *cpp_format_src_files
33
40
dir : " {{.ROOT_DIR}}"
34
41
deps :
35
42
- " cpp-configs"
@@ -42,6 +49,37 @@ tasks:
42
49
ref : " .G_LINT_CPP_DIRS"
43
50
VENV_DIR : " {{.G_LINT_VENV_DIR}}"
44
51
52
+ cpp-static-check :
53
+ # Alias task to `cpp-static-fix` since we don't currently support automatic fixes.
54
+ # NOTE: clang-tidy does have the ability to fix some errors, but the fixes can be inaccurate.
55
+ # When we eventually determine which errors can be safely fixed, we'll allow clang-tidy to
56
+ # fix them.
57
+ desc : " Runs the C++ static analyzers. Only checks for warnings and violations."
58
+ aliases :
59
+ - " cpp-static-fix"
60
+ sources :
61
+ - " {{.G_CMAKE_CACHE}}"
62
+ - " {{.G_COMPILE_COMMANDS_DB}}"
63
+ - " {{.ROOT_DIR}}/**/*.cpp"
64
+ - " {{.ROOT_DIR}}/**/*.h"
65
+ - " {{.ROOT_DIR}}/**/*.hpp"
66
+ - " {{.ROOT_DIR}}/**/*.inc"
67
+ - " {{.ROOT_DIR}}/.clang-tidy"
68
+ - " {{.TASKFILE}}"
69
+ deps :
70
+ - " :config-cmake-project"
71
+ - " cpp-configs"
72
+ - " venv"
73
+ cmds :
74
+ - task : " :utils:clang-tidy"
75
+ vars :
76
+ FLAGS : >-
77
+ --config-file "{{.ROOT_DIR}}/.clang-tidy"
78
+ -p "{{.G_COMPILE_COMMANDS_DB}}"
79
+ SRC_PATHS :
80
+ ref : " .G_LINT_CPP_DIRS"
81
+ VENV_DIR : " {{.G_LINT_VENV_DIR}}"
82
+
45
83
cpp-configs :
46
84
internal : true
47
85
sources :
0 commit comments