Skip to content

Add .clang-format file and format code

Gaël Bonithon requested to merge Tamaranch/mousepad:clang-format into master

The alignment of function parameters and variable declarations is dropped, as this leads to too many realignments as changes are made and, in my opinion, needlessly pollutes diffs. In any case, I believe that the particular alignment used by mousepad:

  MousepadWindow  *window;
  gchar          **str;

is not reproducible with clang-format, which is only capable of producing:

  MousepadWindow *window;
  gchar         **str;

The alignment of function declarations in headers or at the top of source files is also dropped, for the same reasons. The format used is the same as for function definitions: the return type on a separate line and one line per parameter. It's still easy to read and will simplify copy-paste.

The space after the negation operator '!', which I myself had introduced in the past, is dropped (I've changed my mind, it was definitely a bad idea, sorry).

The rest is pretty much unchanged, apart from a few inevitable adaptations here and there.

Related: orage#32, xfce/xfce4-dev-tools!101 (merged)

Edited by Gaël Bonithon

Merge request reports