Correct .clang-tidy syntax


I've been trying to use a .clang-tidy config file to pass parameters to
my checker, but have had no success

When I use the following syntax: (-> I found it here:
<no title> — Extra Clang Tools 16.0.0git documentation)
CheckOptions: {
  - key: my-check.SomeOption1
    value: 123
  - key: my-check.SomeOption2
    value: 'some other value'

I get this error message:
YAML:2:4: error: Unexpected token. Expected Key, Flow Entry, or Flow
Mapping End.
  - key: my-check.SomeOption1

I tried removing the whitespace the arrow points to -> same error,
different location (before 123) -> whitespace removed -> a different error:
YAML:3:10: error: Found unexpected ':' while scanning a plain scalar

At this point I have no idea what to do. Can you spot the error?



Thanks for reporting the problem. The example of configuration contained an error: the braces are not needed in the indented YAML format, they only make sense in the inline format. I’ve fixed the documentation page and help message in r223235.

Also, you can always get an example of a valid configuration file using clang-tidy -dump-config: