<div dir="ltr"><div>Hi,</div><div><br></div><div>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.</div><div><br></div>Also, you can always get an example of a valid configuration file using <font face="monospace">clang-tidy -dump-config</font>:<div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="monospace">$ clang-tidy -dump-config - --</font></div><div><font face="monospace">---</font></div><div><font face="monospace">Checks: '-*,clang-diagnostic-*,llvm-*,misc-*'</font></div><div><font face="monospace">HeaderFilterRegex: ''</font></div><div><font face="monospace">AnalyzeTemporaryDtors: true</font></div><div><font face="monospace">User: alexfh</font></div><div><font face="monospace">CheckOptions: </font></div><div><font face="monospace"> - key: google-readability-braces-around-statements.ShortStatementLines</font></div><div><font face="monospace"> value: '1'</font></div><div><font face="monospace"> - key: google-readability-function-size.StatementThreshold</font></div><div><font face="monospace"> value: '800'</font></div><div><font face="monospace"> - key: google-readability-namespace-comments.ShortNamespaceLines</font></div><div><font face="monospace"> value: '10'</font></div><div><font face="monospace"> - key: google-readability-namespace-comments.SpacesBeforeComments</font></div><div><font face="monospace"> value: '2'</font></div><div><font face="monospace"> - key: llvm-namespace-comment.ShortNamespaceLines</font></div><div><font face="monospace"> value: '1'</font></div><div><font face="monospace"> - key: llvm-namespace-comment.SpacesBeforeComments</font></div><div><font face="monospace"> value: '1'</font></div><div><font face="monospace">...</font></div></div><div><br></div></blockquote><div class="gmail_extra">Also, if you implement the storeOptions method in your check, you can see how your check options are represented in configuration using:</div><div class="gmail_extra"><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div class="gmail_extra"><font face="monospace">$ clang-tidy -checks=-*,your-check-name -dump-config - --</font></div></div></blockquote><div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">-- </div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Alex</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 3, 2014 at 12:44 AM, Szabolcs Sipos <span dir="ltr"><<a href="mailto:labuwx@balfug.com" target="_blank">labuwx@balfug.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi!<br>
<br>
I've been trying to use a .clang-tidy config file to pass parameters to<br>
my checker, but have had no success<br>
<br>
When I use the following syntax: (-> I found it here:<br>
<a href="http://clang.llvm.org/extra/clang-tidy.html#configuring-checks" target="_blank">http://clang.llvm.org/extra/clang-tidy.html#configuring-checks</a>)<br>
CheckOptions: {<br>
- key: my-check.SomeOption1<br>
value: 123<br>
- key: my-check.SomeOption2<br>
value: 'some other value'<br>
}<br>
<br>
I get this error message:<br>
YAML:2:4: error: Unexpected token. Expected Key, Flow Entry, or Flow<br>
Mapping End.<br>
- key: my-check.SomeOption1<br>
^<br>
<br>
I tried removing the whitespace the arrow points to -> same error,<br>
different location (before 123) -> whitespace removed -> a different error:<br>
YAML:3:10: error: Found unexpected ':' while scanning a plain scalar<br>
value:123<br>
^<br>
<br>
At this point I have no idea what to do. Can you spot the error?<br>
<br>
Thanks<br>
<span class=""><font color="#888888">--<br>
Szabolcs Sipos<br></font></span></blockquote></div>
</div></div></div>