]> WPIA git - cassiopeia.git/commitdiff
upd: improve format script
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Tue, 28 Feb 2017 13:13:09 +0000 (14:13 +0100)
committerLucas Werkmeister <mail@lucaswerkmeister.de>
Tue, 11 Apr 2017 19:13:16 +0000 (21:13 +0200)
- exec astyle to shave off a fork()
- Align pointers to names. In

      int* a, b;

  only a is a pointer, b isn’t. The alignment to names,

      int *a, b;

  makes this clearer.
- Don’t create backup files – everything’s under version control.
- Don’t format the libraries, there’s no point in that.
- Spell out the recursive option (long form), for readability and
  consistency with the other options (which we also spell out).

Change-Id: Id87beb4351e8b63ae4c492b44f57d38561c2fc85

scripts/format.sh

index b8b7061238d3574c142010b6eeb986b31e205827..ada110aaa5f007944c9ed7cda28bbc89922ba813 100755 (executable)
@@ -1,2 +1,2 @@
 #!/bin/sh
-astyle --style=java --add-brackets --indent-col1-comments --break-blocks --pad-oper --pad-paren-in --unpad-paren --indent-namespaces --align-pointer=type --align-reference=type --convert-tabs --lineend=linux -r "*.cpp" "*.h" '*.hpp'
+exec astyle --style=java --add-brackets --indent-col1-comments --break-blocks --pad-oper --pad-paren-in --unpad-paren --indent-namespaces --align-pointer=name --align-reference=type --convert-tabs --lineend=linux --suffix=none --exclude=lib --recursive "*.cpp" "*.h" '*.hpp'