Hi Stephan, On Fri, Nov 17, 2017 at 10:03:11AM +0100, Stephan Bergmann <sberg...@redhat.com> wrote: > Some random points regarding our recently introduced use of clang-format: > > > * clang-format cannot automatically reformat code > > Most comments in the code are written by humans, for humans. They are often > placed in a way that makes it technically unclear what code they pertain to, > relying on humans to nevertheless easily discern that. For example, in > > > void f(int x) { g(x + 1); } // long comment explaining how g internally > > subtracts one > > the comment clearly pertains to the call to g. Yet, clang-format will > reformat this to something like > > > void f(int x) > > { > > g(x + 1); > > } // long comment explaining how g internally subtracts one > > instead of > > > void f(int x) > > { > > g(x + 1); // long comment explaining how g internally subtracts one > > } > > thereby obscuring things. Always review automatically reformatted code for > glitches like this.
Thanks for mentioning this. I also noticed something similar with initializer lists, where Foo::Foo() : foo(1), // foo bar(2) // bar { } gets reformatted to: Foo::Foo() : foo(1) , // foo bar(2) // bar { } but the ideal form is probably Foo::Foo() : foo(1) // foo , bar(2) // bar { } instead. Regards, Miklos
signature.asc
Description: Digital signature
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice