-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include paths not set up to use clang-tidy #40
Comments
@jwbmwv Hi, are you using a vscode-extension for Clang-Tidy and if so, which one? To me it seems like they typically work using a compilation database, much like the clangd extension. You can generate a compilation database using iarbuild and ninja but that will unfortunatly not be compatible with clang. |
I'm using notskm.clang-tidy I have no proof, but it appears that iar-build does not expose the include paths in a manor that this extension and/or clang-tidy itself can consume. The result is a list of include errors in the Problems tab for every file I open. This makes me ignore the problem window and miss useful messages. I have not had problems. This appears to happen with any extension of this sort that does not generate a c_cpp_properties.json file automatically. i.e. Microsoft's Embedded Tools when importing an STM32Cube project. |
Reading up on https://clang.llvm.org/extra/clang-tidy/ refers to the compilation database, from which the clang typically sources its information. I glanced through the source code for notskm.clangtidy and it support adding it supports adding options to the command line under clang-tidy.compilerArgs so you could possibly append the include paths there. |
I successfully use clang-tidy with iar-build from the C/C++ Microsoft plugin, which has clang-tidy inside. It is possible to set this up in your settings / code workspace with:
You can exclude files with: and optionally run it automatically with
See microsoft/vscode-cpptools#7816 for details |
Hello, I have been setting up clang-tidy using the c/c++ extension from vscode as @spoorcc suggested. The problem is that the extension is always trying to analyze the IAR compiler's standard lib source files and giving errors. How can I exclude such files? Example message: |
I like to use clang-tidy as my static analysis tool inside VS Code. This extension does not initialize the include paths that are needed for it, or any other extension needing paths to work properly since the proper header files annot be found.
The text was updated successfully, but these errors were encountered: