From 561aab8a68243e84a1b617037cafc28b6994af94 Mon Sep 17 00:00:00 2001 From: Sergio Date: Mon, 4 Nov 2024 11:49:14 +0100 Subject: [PATCH] test --- .github/workflows/format.yml | 11 ++++++----- src/Configuration.cxx | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index d1a4c0e..7a42a28 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -4,8 +4,7 @@ on: [pull_request] jobs: clang-format-8: - runs-on: ubuntu-latest - container: "docker://ghcr.io/wolletd/clang-format:latest" + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: @@ -13,15 +12,17 @@ jobs: - name: Run clang-format on changed files run: | set -x + sudo apt install clang-format + git config --global --add safe.directory '*' git fetch origin ${{ github.event.pull_request.base.ref }} git fetch origin pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }} BASE_COMMIT=$(git rev-parse ${{ github.event.pull_request.base.sha }}) COMMIT_FILES=$(git diff --name-only "${BASE_COMMIT}" | grep -i -v LinkDef) - RESULT_OUTPUT=$(git-clang-format-8 --commit "${BASE_COMMIT}" --diff --binary "$(which clang-format-8)" "${COMMIT_FILES}") + RESULT_OUTPUT=$(git clang-format --commit "${BASE_COMMIT}" --diff --binary "$(which clang-format)" -- "${COMMIT_FILES}") if [ "$RESULT_OUTPUT" == "no modified files to format" ] || [ "$RESULT_OUTPUT" == "clang-format did not modify any files" ]; then exit 0 else - git-clang-format-8 --commit "$BASE_COMMIT" --diff --binary "$(which clang-format-8)" + git-clang-format --commit "$BASE_COMMIT" --diff --binary "$(which clang-format)" echo "$RESULT_OUTPUT" exit 1 - fi + fi diff --git a/src/Configuration.cxx b/src/Configuration.cxx index c4a7440..99d3137 100644 --- a/src/Configuration.cxx +++ b/src/Configuration.cxx @@ -74,7 +74,7 @@ void ConfigFile::load(const std::string path) if (boost::algorithm::ends_with(filename, suffix)) { try { boost::property_tree::ini_parser::read_ini(filename, dPtr->pt); - } catch (boost::property_tree::ini_parser::ini_parser_error perr) { + } catch (boost::property_tree::ini_parser::ini_parser_error const &perr) { std::stringstream ss; if (perr.line()) { ss << perr.message() << " in " << perr.filename() << " line " << perr.line();