<div dir="ltr"><div>Please attach patches as plain text, not as zip-files. Or alternatively, use phabricator (<a href="http://llvm-reviews.chandlerc.com/">http://llvm-reviews.chandlerc.com/</a>).</div><div><br></div><div>Comments inline.</div>
<div><br></div><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">
+  /// \brief Indent the content of namespaces by one level.<br>+  ///<br>+  /// When false, use the same indentation level as outside block (file or namespace).<br></blockquote><div><br></div><div>Please adhere to the 80 column limit. Or ideally, just use clang-format ;-).</div>
<div> </div><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">+  bool IndentNamespaces;<br></blockquote><div>
<br></div><div>IndentInNamespaces might be slightly more precise, but I am not sure.</div><div>   </div><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">

-    parseBlock(/*MustBeDeclaration=*/true, 0);<br>+    parseBlock(/*MustBeDeclaration=*/true, /*AddLevels=*/Style.IndentNamespaces);<br></blockquote><div><br></div><div>Please adhere to the 80 column limit.</div><div> </div>
<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">+  FormatStyle getLLVMStyleWithIndentNamespaces(bool IndentNamespaces = true) {<br>
+    FormatStyle Style = getLLVMStyle();<br>+    Style.IndentNamespaces = IndentNamespaces;<br>
+    return Style;<br>+  }<br>+  <br>+  FormatStyle getGoogleStyleWithIndentNamespaces(bool IndentNamespaces = true) {<br>+    FormatStyle Style = getGoogleStyle();<br>+    Style.IndentNamespaces = IndentNamespaces;<br>+    return Style;<br>

+  }<br></blockquote><div><br></div><div>I don't think it is worth adding these methods. Just define a local style in your test:</div><div><br></div><div>TEST_F(..., ...) {</div><div>  FormatStyle Style = getLLVMStyle();</div>
<div>  Style.IndentNamespace = true;</div><div>  ...</div><div>}</div><div><br></div><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">
<br>On Fri, Jul 26, 2013 at 2:17 PM, Curdeius Curdeius <span dir="ltr"><<a href="mailto:curdeius@gmail.com" target="_blank" class="cremed">curdeius@gmail.com</a>></span> wrote:<br>Hi,<br>Clang-format was lacking an option to add indentation within namespaces.<br>

I've created a patch that adds this option to clang::Format::FormatStyle.<br>There is also a basic test.<br>You'll find it in the attachment.<br>I think it will be nice to have a possibility to indent only the content of namespaces, but excluding the inner namespaces, i.e. to have something like:<br>

 <br>  class Indented1;<br>namespace inner1 {<br>

  class Indented2;<br>} // namespace inner1<br>namespace inner2 {<br>} // namespace inner2<br>} // namespace outer<br>instead of: <br> <br>  class Indented1;<br>  namespace inner1 {<br>    class Indented2;<br>  } // namespace inner1<br>

  namespace inner2 {<br>  } // namespace inner2<br>} // namespace outer<br></blockquote><div><br></div><div>Really? I have never seen the latter before and it would confuse me quite a bit.</div><div><br></div><div>Cheers,<br>
Daniel</div><div class="gmail_extra"><br></div></div>