Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whatever #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ 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:
ref: ${{ github.event.pull_request.head.sha }}
- 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
2 changes: 1 addition & 1 deletion src/Configuration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down