CI: fix edge cases for calamaresstyle

- no format-10
- skip empty directories (otherwise astyle gets no file-paramaters
  and then hangs on stdin)
This commit is contained in:
Adriaan de Groot 2020-08-25 23:43:15 +02:00
parent 3ae4ccf402
commit 4a45eb847d

View File

@ -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()
{
if test -n "$*" ; then
$AS --options=$(dirname $0)/astylerc --quiet "$@"
$CF -i -style=file "$@"
fi
}
if test "x$any_dirs" = "xyes" ; then