From e87fc603911dd66f22b2fab96569c49a00729d04 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Sat, 27 Aug 2022 17:20:10 +0200 Subject: [PATCH] misc: update clang-format files --- .clang-format | 7 ++++--- misc/scripts/upx-clang-format | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.clang-format b/.clang-format index 1bdf5d62..f6aa154f 100644 --- a/.clang-format +++ b/.clang-format @@ -1,5 +1,6 @@ -# for clang-format-10.0.1 -# "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." Rob Pike +# "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." --Rob Pike +# +# for clang-format-10.0.1 from https://github.com/upx/upx-stubtools/releases --- BasedOnStyle: LLVM AccessModifierOffset: -4 @@ -9,6 +10,7 @@ ColumnLimit: 100 IndentWidth: 4 SortIncludes: false SpaceAfterCStyleCast: true +Standard: Cpp03 StatementMacros: [ ACCCHK_ASSERT, ACCCHK_ASSERT_IS_SIGNED_T, @@ -23,5 +25,4 @@ StatementMacros: [ COMPILE_TIME_ASSERT, COMPILE_TIME_ASSERT_ALIGNED1, ] -Standard: Cpp03 ... diff --git a/misc/scripts/upx-clang-format b/misc/scripts/upx-clang-format index 5f925d0b..c1b83454 100755 --- a/misc/scripts/upx-clang-format +++ b/misc/scripts/upx-clang-format @@ -2,11 +2,13 @@ ## vim:set ts=4 sw=4 et: set -e; set -o pipefail -# "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." Rob Pike +# "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." --Rob Pike # NOTE: we are using clang-format-10.0.1 from upx-stubtools # see https://github.com/upx/upx-stubtools/releases +# NOTE: we use .clang-format config from upx.git/.clang-format + if [[ ! -f $UPX_CLANG_FORMAT ]]; then UPX_CLANG_FORMAT="$HOME/local/bin/bin-upx/clang-format-10.0.1" fi @@ -22,7 +24,8 @@ if [[ ! -f $UPX_CLANG_FORMAT ]]; then exit 1 fi -# NOTE: we use .clang-format config from upx.git/.clang-format +# limit memory usage to 1 GiB (in case of clang-format problems with invalid files) +ulimit -v 1048576 || true #echo $UPX_CLANG_FORMAT exec "$UPX_CLANG_FORMAT" -style=file "$@"