This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CODECOMPOSER:如何为工程创建自定义配置

Guru**** 2405245 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/1542376/codecomposer-how-to-create-custom-config-for-clangd-for-project

部件号:CODECOMPOSER


工具/软件:

你好  
我正在 CCS 20 中的一个项目中集成 CLANG-TIDY 检查
clangd 帮助显示了.clangd 文件可用于配置特定工程的选项

>clangd --help

...

--enable-config                     - Read user and project configuration from YAML files.
                                        Project config is from a .clangd file in the project directory.
                                        User config is from clangd/config.yaml in the following directories:
                                                Windows: %USERPROFILE%\AppData\Local
                                                Mac OS: ~/Library/Preferences/
                                                Others: $XDG_CONFIG_HOME, usually ~/.config

由于.clang-tidy 文件当前没有 spported、我想知道是否可以将 clang-tidy 格式转换为.clangd 格式、并使 clangd 将其用于工程

在同一环境下、如何在 CI 中使用 clangd 生成有关失败检查的报告?

在另一种方法中、我尝试使用 C:\ti\ccs2020\ccs\tools\compiler\ti-cgt-armllvm_4.0.3.LTs\bin\tiarmclang-tidy.exe 编译器工具以及位于下的 compile_commands.json 文件 / /.clangd/

tiarmclang 编译器工具不适用于该文件  

PS:我在项目根目录中有一个有效的 clang-tidy 文件

>C:\ti\ccs2020\ccs\tools\compiler\ti-cgt-armllvm_4.0.3.LTS\bin\tiarmclang-tidy.exe -p Debug/.clangd gpio_toggle_output.c
Error while processing <ProjPath>\gpio_toggle_output.c.
error: no input files [clang-diagnostic-error]
error: unable to handle compilation, expected exactly one compiler job in '' [clang-diagnostic-error]
Found compiler error(s).

我们如何生成有效的 compile_commands.json 文件来与 tiarmclang 一同使用;或者如何以某种方式编辑 clangd 生成的文件以使其兼容

好极了  
Radhwen

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好:

    我尝试在.clangd 文件中添加一个 clang-tidy 检查、但似乎仍然没有得到接收。 它可能与.clang-tidy 文件的限制有关。 我需要进一步与工程部门讨论。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Ki、

    如果我们要在工程配置中指定 CLAG-tidy 选项、我们如何实现以下目标

    *从 Glob 中删除支票
    *指定一个检查选项值
      

    ---
    Checks: >
      bugprone-*,
      -bugprone-easily-swappable-parameters,
    CheckOptions:
      - key: bugprone-signed-char-misuse.CharTypdefsToIgnore
        value: int8_t;uint8_t


    在上面的片段中、我们添加了所有 bugribe 检查并删除了“bugrive-assisty-swappeating-parameters"检查“检查。 我们还想为其他容易出错的检查之一的选项分配一个特定值

    我们如何使用 Code Composer 实现这一点?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    如果我们要在项目配置中指定 CLAG-tidy 选项、我们如何实现以下目标

    再说一次、我认为这个功能目前不起作用。 我们需要为此增加支持。