15

Is there a place that documents the .clang-tidy config file? All I could find is this:

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

specifically I would like to know what the valid values for FormatStyle and CheckOptions are.

xeruf
  • 2,602
  • 1
  • 25
  • 48
Ezra
  • 1,401
  • 5
  • 15
  • 33

1 Answers1

12

I think I got it or at least part of it:

From the command line run $ clang-tidy-6.0 -checks=* --dump-config to see all CheckOptions values

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

and as for the FormatStyle options these are the same values you could specify for -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.
Ezra
  • 1,401
  • 5
  • 15
  • 33