From 7f7c70bc187d3f6f8f3d5b378d04fbb807cbeb39 Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Thu, 6 Jan 2022 22:22:31 +0000 Subject: [PATCH] Run clang_format_check in deterministic location Implements #737 --- industrial_ci/src/tests/clang_format_check.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/industrial_ci/src/tests/clang_format_check.sh b/industrial_ci/src/tests/clang_format_check.sh index ec2074860..72a4c1ac2 100644 --- a/industrial_ci/src/tests/clang_format_check.sh +++ b/industrial_ci/src/tests/clang_format_check.sh @@ -19,10 +19,10 @@ function prepare_clang_format_check() { true } -function run_clang_format_check() { - local err=0 - local path - ici_make_temp_dir path +function install_clang_format_check() { + local path=/tmp/clang_format_check + mkdir -p "$path" + ici_cleanup_later "$path" # Check whether a specific version of clang-format is desired local clang_format_executable="clang-format${CLANG_FORMAT_VERSION:+-$CLANG_FORMAT_VERSION}" @@ -34,6 +34,11 @@ function run_clang_format_check() { local sources=() ici_parse_env_array sources TARGET_WORKSPACE ici_step "prepare_sourcespace" ici_prepare_sourcespace "$path" "${sources[@]}" +} + +function run_clang_format_check() { + local err=0 + local path=/tmp/clang_format_check ici_time_start run_clang_format_check while read -r file; do