File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -214,28 +214,28 @@ int main()
214
214
To run clang-tidy on Ubuntu/Debian, install the dependencies:
215
215
216
216
```sh
217
- apt install clang-tidy bear clang
217
+ apt install clang-tidy clang
218
218
```
219
219
220
- Then, pass clang as compiler to configure, and use bear to produce the ` compile_commands.json ` :
220
+ Configure with clang as the compiler :
221
221
222
222
``` sh
223
- ./autogen.sh && ./configure CC =clang CXX =clang++
224
- make clean && bear --config src/.bear-tidy-config -- make -j $( nproc)
223
+ cmake -B build -DCMAKE_C_COMPILER =clang -DCMAKE_CXX_COMPILER =clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
224
+ cmake --build build -j $( nproc)
225
225
```
226
226
227
227
The output is denoised of errors from external dependencies.
228
228
229
229
To run clang-tidy on all source files:
230
230
231
231
``` sh
232
- ( cd ./src/ && run-clang-tidy -j $( nproc) )
232
+ ( cd ./src/ && run-clang-tidy -p ../build -j $( nproc) )
233
233
```
234
234
235
235
To run clang-tidy on the changed source lines:
236
236
237
237
``` sh
238
- git diff | ( cd ./src/ && clang-tidy-diff -p2 -j $( nproc) )
238
+ git diff | ( cd ./src/ && clang-tidy-diff -p2 -path ../build - j $( nproc) )
239
239
```
240
240
241
241
Coding Style (Python)
You can’t perform that action at this time.
0 commit comments