代码之家  ›  专栏  ›  技术社区  ›  Ezra

什么是合法的钥匙。叮当叮当

  •  1
  • Ezra  · 技术社区  · 7 年前

    有文件的地方吗。叮当地整理文件?我只能找到这个:

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

    具体来说,我想知道FormatStyle的有效值是什么,CheckOptions的可能键是什么。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Ezra    7 年前

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

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

    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

    -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.