最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin5浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论