c++ - Clang-Tidy in Trunk Runs but Doesn't Show Issues in VS Code Sidebar - Stack Overflow

I'm using Trunk in VS Code to run clang-tidy as a linter for my C++ project. When I run:trunk che

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:

  1. Confirmed that clang-tidy is enabled in .trunk/trunk.yaml:

    lint:
    
        enabled:
    
            - [email protected]
    
  2. Made sure I have a .clang-tidy config file in the project root.

  3. Generated compile_commands.json file using bear.

  4. Verified that clang-tidy issues appear when running trunk check in the terminal.

  5. Restarted VS Code and reloaded the Trunk extension.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744411029a4572876.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信