<p dir="ltr">That's out of scope for clang-format. Clang-format is designed to only make whitespace changes, not to introduce or remove tokens.</p>
<p dir="ltr">Clang-tidy is the next project (in very early stages) layered on top of clang-format that will make the kind of changes you're talking about.</p>
<div class="gmail_quot<blockquote class=" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>I'd like to add an additional rule to clang-format.</div><div>Namely, I'd like to have an option to surround short if statements and short loops with braces '{', '}'.</div>
<div>What's the best way to do it, i.e. to add an additional token (here, tok::l_brace and tok::r_brace)?</div><div><br></div><div>Regards,</div><div>Marek Kurdej</div>
</div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></div>