如何将 -fix 选项添加到 .clang-tidy 文件
How to add -fix option to .clang-tidy file?
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 文档中有说明,-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
的命令中即可。
相关文章:
- 如何将多种语言设置放在单个 .clang 格式文件中
- 是否可以将 Clang-Tidy 与 QNX 一起使用?
- Clang Tidy 插件 for Visual Studio Code 不起作用/如何设置
- 如何在 CMakeLists.txt for Visual Studio 2019 中启用 clang-tidy?
- clang-tidy 忽略 Windows 上的可读性标识符命名
- VSCode中的Clangd:.clang格式和.clang整洁文件
- 有没有办法在初始化字符串时避免来自 clang-tidy(fuchsia-default-arguments)的警告?
- 在Clang Tidy检查中获取Vardecl的类型
- Clang-Tidy:移动构造函数通过调用复制构造函数来初始化类成员
- clang tidy pro type member init resharper
- clang-tidy检查需要围绕化合物表达式的括号
- 有没有办法强制对 clang-format/clang-tidy 中的类成员/方法使用 "this->"?
- 如何安装 clang 头文件
- 使用 clang-tidy 检查 c++17 代码
- 如何将 -fix 选项添加到 .clang-tidy 文件
- clang-tidy llvm-header-guard目录配置
- 如何指定一个clang-format文件
- 在禁用Clang Tidy检查的内联方法
- 如何向Visual Studio Clang-Format插件提供clang格式文件
- 带有调试符号的Clang二进制文件太大