I'm using Trunk in VS Code to run clang-tidy
as a linter for my C++ project. When I run:
trunk check
I can see clang-tidy
running in the output, and it does find issues:
...
...
...
10:2 medium Call to virtual method 'UdpLayer::parseHeader' during construction bypasses virtual clang-tidy/clang-analyzer-optin.cplusplus.VirtualCall
dispatch
70:24 medium do not use pointer arithmetic clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic
70:48 medium do not use pointer arithmetic clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic
71:29 medium do not use pointer arithmetic clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic
71:53 medium do not use pointer arithmetic clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic
77:20 medium do not use pointer arithmetic clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic
77:44 medium do not use pointer arithmetic clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic
78:22 medium do not use pointer arithmetic clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic
78:46 medium do not use pointer arithmetic clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic
91:5 medium missing username/bug in TODO clang-tidy/google-readability-todo
96:5 medium missing username/bug in TODO clang-tidy/google-readability-todo
Checked 25 files
✖ 23 unformatted files
✖ 191 lint issues (98 auto-fixable)
However, these issues do not appear in the Trunk sidebar in VS Code:
Trunk sidebar in vscode showing only clang-format's insights but not clang-tidy's
These are the things I tried:
Confirmed that
clang-tidy
is enabled in.trunk/trunk.yaml
:lint:
enabled:
- [email protected]
Made sure I have a
.clang-tidy
config file in the project root.Generated
compile_commands.json
file usingbear
.Verified that
clang-tidy
issues appear when runningtrunk check
in the terminal.Restarted VS Code and reloaded the Trunk extension.