Re: clang-format syntax



Den 2016-02-11 kl. 14:21, skrev Murray Cumming:
I'd quite like to run clang-format on all our source code. I'd even
like to optionally run it over our generated source code at build time.

I've added a clang-format syntax file for people to try out:
https://git.gnome.org/browse/gtkmm/commit/?id=66f1468b7548e22dd574f170c
5930c9e61724200

At this point we might want to agree on a code style, if we can,
without bikeshedding, please. If you have ever provided a patch or
commit and you have an opinion, please give it briefly.


This is my proposal:

  BasedOnStyle: Mozilla
  Standard: Cpp11
  AlignAfterOpenBracket: false
  AlignEscapedNewlinesLeft: true
  AlwaysBreakAfterDefinitionReturnType: None
  BreakBeforeBraces: Allman
  ColumnLimit: 100
  IndentCaseLabels: false

The differences from your patch is that I've added

  AlignEscapedNewlinesLeft: true
  AlwaysBreakAfterDefinitionReturnType: None
  ColumnLimit: 100
  IndentCaseLabels: false

and removed

  SpaceBeforeParens: Never

These differences are not important to me. I can accept most formatting rules. Consistent formatting is important, but the exact rules are not.

A rule that I do dislike is the kind of double indentation used in glib and gtk+.

  if (is_doable) // NOT my favorite format
    {
      do_phase1();
      do_phase2();
    }

Kjell



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]