<div dir="ltr">Would be that much effort, but not sure clang-format wants to commit to it. At some point, I have actually noted down the requirements for additional options:<div><br></div><div><a href="http://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options">http://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 13, 2015 at 9:00 PM, Piotr Padlewski <span dir="ltr"><<a href="mailto:piotr.padlewski@gmail.com" target="_blank">piotr.padlewski@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi folks,<div>so recently I was enforcing clang-format in the team that I work with, and we found out 2 things that can't be configured and that are formated not in the way that we would like to:</div><div><br></div><div>1. typedefs</div><div>so many times people use style like this for typedefs</div><div><br></div><div><div>struct Predicate</div><div>{</div><div> typedef std::shared_ptr<Predicate> Ptr;</div><div> typedef std::map<std::string, std::string> Params;</div><div>};</div></div><div><br></div><div>So as you can see the type names are aligned, and sometimes there is larger space between name and type.</div><div>I guess this can be solved using using like this:</div><div><div>struct Predicate</div><div>{</div><div> using Ptr = std::shared_ptr<Predicate>; </div><div> using Params = std::map<std::string, std::string>;</div><div>};</div></div><div><br></div><div>because of the = align, but sometimes you can't use c++11 etc so it's not the answer to every case.</div><div><br></div><div>2. The second thing is about macros and the operator ## - on default it is glued </div><div><br></div><div><div>#define CREATE_EVENT_ACCESSORS(Field, Type) \</div><div> struct Field##Accessors \</div><div> { \</div><div> template <class E> \</div><div> const Type &get(const E &e) const \</div><div> { \</div><div> return e.ref##Field(); \</div><div> } \</div><div> template <class E> \</div><div> void set(E &e, const Type &value) \</div><div> { \</div><div> e.set##Field(value); \</div><div> } \</div><div> };</div></div><div><br></div><div>and there is no way to configure it as normal operator (with spaces arround).</div><div>My question is: would it be simple to add this options? If it woudn't require too much effort I would like to add this features.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Piotr</div><div><br></div></font></span></div>
</blockquote></div><br></div>