gpt4 book ai didi

c++ - 如何将 -fix 选项添加到 .clang-tidy 文件?

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:04:01 25 4
gpt4 key购买 nike

Checks: 'modernize-use-auto, modernize-use-nullptr, modernize-loop-convert'

CheckOptions:
- key: modernize-loop-convert.MinConfidence
value: safe

我有一个这样的配置文件,想添加 -fix 标志以应用可能的修复,但我无法弄清楚它的确切位置。是否可以将 -fix-fix-errors 标志添加到 .clang-tidy 文件?

最佳答案

-fix-fix-errors 不是检查选项,而是命令行选项,不能单独配置检查。.clang-tidy 文件的可用配置选项在 Clang-tidy documentation 中说明-fix 选项不存在:

$ clang-tidy -dump-config
---
Checks: '-*,some-check'
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
User: user
CheckOptions:
- key: some-check.SomeOption
value: 'some value'
...

如果你想在启用 -fix 选项的情况下运行你的配置,只需将它添加到你正在运行 clang-tidy 的命令中。

关于c++ - 如何将 -fix 选项添加到 .clang-tidy 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53981932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com