CI: adjust to clang-format-10 automatically
- leave clang-format file alone, but dynamically modify it when clang-format 10 or later is present - ignore the resulting .bak file
This commit is contained in:
parent
e94c17e331
commit
17914b9cf9
1
.gitignore
vendored
1
.gitignore
vendored
@ -50,6 +50,7 @@ CMakeLists.txt.user
|
||||
|
||||
# Backup files
|
||||
*~
|
||||
*.bak
|
||||
|
||||
# Kate
|
||||
*.kate-swp
|
||||
|
@ -35,7 +35,13 @@ test -n "$CF" || { echo "! No clang-format ($CF_VERSIONS) found in PATH"; exit 1
|
||||
test -x "$AS" || { echo "! $AS is not executable."; exit 1 ; }
|
||||
test -x "$CF" || { echo "! $CF is not executable."; exit 1 ; }
|
||||
|
||||
expr `"$CF" --version | tr -dc '[^.0-9]' | cut -d . -f 1` '<' 10 > /dev/null || { echo "! $CF is version 10 or later, needs different .clang-format" ; exit 1 ; }
|
||||
unmangle_clang_format=""
|
||||
if expr `"$CF" --version | tr -dc '[^.0-9]' | cut -d . -f 1` '<' 10 > /dev/null ; then
|
||||
:
|
||||
else
|
||||
unmangle_clang_format=$( dirname $0 )/../.clang-format
|
||||
echo "SpaceInEmptyBlock: false" >> "$unmangle_clang_format"
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
@ -65,3 +71,7 @@ if test "x$any_dirs" = "xyes" ; then
|
||||
else
|
||||
style_some "$@"
|
||||
fi
|
||||
|
||||
if test -n "$unmangle_clang_format" ; then
|
||||
sed -i.bak '/^SpaceInEmptyBlock/d' "$unmangle_clang_format"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user