首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >.clang-tidy配置文件中允许使用什么值?

.clang-tidy配置文件中允许使用什么值?
EN

Stack Overflow用户
提问于 2018-10-28 05:30:50
回答 1查看 4K关注 0票数 9

有没有记录.clang-tidy配置文件的地方?我能找到的就是:

代码语言:javascript
复制
$ clang-tidy -dump-config
---
Checks:          '-*,some-check'
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle:     none
User:            user
CheckOptions:
  - key:             some-check.SomeOption
    value:           'some value'

具体地说,我想知道FormatStyle和CheckOptions的有效值是什么。

EN

回答 1

Stack Overflow用户

发布于 2018-10-28 05:57:16

我想我明白了,或者至少部分明白了:

从命令行运行$ clang-tidy-6.0 -checks=* --dump-config以查看所有CheckOptions值

代码语言:javascript
复制
Checks:          'clang-diagnostic-*,clang-analyzer-*,*'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle:     none
CheckOptions:
- key:             bugprone-argument-comment.StrictMode
  value:           '0'
- key:             bugprone-assert-side-effect.AssertMacros
  value:           assert`$ clang-tidy-6.0 -checks=* --dump-config
  .
  .
  .

至于FormatStyle选项,这些值与您可以为-format-style指定的值相同

代码语言:javascript
复制
-format-style=<string>        -
                              Style for formatting code around applied fixes:
                                - 'none' (default) turns off formatting
                                - 'file' (literally 'file', not a placeholder)
                                  uses .clang-format file in the closest parent
                                  directory
                                - '{ <json> }' specifies options inline, e.g.
                                  -format-style='{BasedOnStyle: llvm, IndentWidth: 8}'
                                - 'llvm', 'google', 'webkit', 'mozilla'
                              See clang-format documentation for the up-to-date
                              information about formatting styles and options.
                              This option overrides the 'FormatStyle` option in
                              .clang-tidy file, if any.
票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53026453

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档