You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`clang-tidy` is a clang-based C++ linter tool for diagnosing and fixing typical programming errors, like style violations or bugs.
53
+
Clang-Tidy is a clang-based C++ linter tool for diagnosing and fixing typical programming errors, like style violations or bugs.
54
54
(See the [list of checks](https://clang.llvm.org/extra/clang-tidy/checks/list.html).)
55
55
56
-
To use `clang-tidy`, you need to have O2Physics compiled and a valid symbolic link `compile_commands.json` in the O2Physics directory pointing to the `alice/sw/BUILD/.../O2Physics` directory.
56
+
To use Clang-Tidy, you need to have O2Physics compiled and a valid symbolic link `compile_commands.json` in the O2Physics directory pointing to the `alice/sw/BUILD/.../O2Physics` directory.
The [`parallel`](https://www.gnu.org/software/parallel/) command is used to parallelise the execution of the `clang-tidy` command for all files.
76
76
77
-
For each file, `clang-tidy` will first try to compile it and then run the enabled check(s) and fix found problems (the `--fix` option).
77
+
For each file, Clang-Tidy will first try to compile it and then run the enabled check(s) and fix found problems (the `--fix` option).
78
78
The messages are redirected into `clang-tidy.log`.
79
-
The file name and the exit code are printed below the output of `clang-tidy` so that you can get the list of files for which `clang-tidy` failed with `grep " 1$" "clang-tidy.log"`.
79
+
The file name and the exit code are printed below the output of Clang-Tidy so that you can get the list of files for which Clang-Tidy failed with `grep " 1$" "clang-tidy.log"`.
80
80
81
81
## Fixing include format
82
82
@@ -92,14 +92,14 @@ To fix the include format in all `.h`, `.cxx` files in the current directory, ex
`cppcheck` is a static analysis tool for C/C++ code that detects bugs, undefined behaviour, and dangerous coding constructs that compilers typically miss.
97
+
Cppcheck is a static analysis tool for C/C++ code that detects bugs, undefined behaviour, and dangerous coding constructs that compilers typically miss.
98
98
99
-
`cppcheck` can analyse individual files (file mode) or entire projects (project mode).
99
+
Cppcheck can analyse individual files (file mode) or entire projects (project mode).
100
100
The two modes give slightly different results so one can consider using both for maximum coverage.
101
101
102
-
### Using cppcheck in file mode
102
+
### Using Cppcheck in file mode
103
103
104
104
The file mode is used in the MegaLinter check on GitHub.
Note: It is possible to parallelise the execution with the `-j` option instead but it usually produces less results than analysing files independently.
121
121
122
-
### Using cppcheck in project mode
122
+
### Using Cppcheck in project mode
123
123
124
124
To use this mode, you need to have O2Physics compiled and a valid symbolic link `compile_commands.json` in the O2Physics directory pointing to the `alice/sw/BUILD/.../O2Physics` directory.
0 commit comments