From 4a45eb847d420be9cfd88453a904cf333ee36471 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 25 Aug 2020 23:43:15 +0200 Subject: [PATCH] CI: fix edge cases for calamaresstyle - no format-10 - skip empty directories (otherwise astyle gets no file-paramaters and then hangs on stdin) --- ci/calamaresstyle | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ci/calamaresstyle b/ci/calamaresstyle index 44f9fe91f..19f4a152a 100755 --- a/ci/calamaresstyle +++ b/ci/calamaresstyle @@ -1,7 +1,12 @@ #!/bin/sh # # Calls astyle with settings matching Calamares coding style -# Requires astyle >= 2.04 and clang-format-7 +# Requires astyle >= 2.04 and clang-format-7 -8 or -9 +# +# Clang-format-10 is **not** supported, since it changes a default +# that re-introduces a space into empty function bodies; this +# can be turned off with a style setting, but that breaks +# older format versions which don't recognize the setting. # # You can pass in directory names, in which case the files # in that directory (NOT below it) are processed. @@ -38,8 +43,10 @@ done style_some() { - $AS --options=$(dirname $0)/astylerc --quiet "$@" - $CF -i -style=file "$@" + if test -n "$*" ; then + $AS --options=$(dirname $0)/astylerc --quiet "$@" + $CF -i -style=file "$@" + fi } if test "x$any_dirs" = "xyes" ; then