notskm / vscode-clang-tidy

MIT License
49 stars 25 forks source link

Support Clang-Tidy command line arguments #10

Closed mjheilmann closed 4 years ago

mjheilmann commented 4 years ago

There is not a way to pass command line arguments to Clang-Tidy.

For example: When building using CMake, the compiler_commands.json file is not placed in the project root, but under the build/ folder, You direct Clang-Tidy to look in that location by passing the argument -p build/.

notskm commented 4 years ago

I can add a setting for this. It should only take a few minutes. I'll probably get around to this within a few days.

notskm commented 4 years ago

If you're using cmake-tools, there's an option to copy compile_commands.json to whatever folder you'd like. Honestly, I think this is a better solution than using clang-tidy -p since many tools expect this file to be in the project root anyway. The setting you want is cmake.copyCompileCommands.

I still plan on supporting extra arguments, but it may be a while.

mjheilmann commented 4 years ago

Its a large project out of my control, I cannot move the compile_commands.json file. Since I'm on Linux, I added a symbolic link to the project root with success.

notskm commented 4 years ago

clang-tidy.buildPath is supported and the issues with it should be fixed in 0.5.0