Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicDirkx committed Feb 4, 2025
2 parents a134af7 + 4e1146f commit 52e039f
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.14.0.dev1
current_version = 2.14.0.dev2
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
Expand Down
2 changes: 0 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
Language: Cpp
BasedOnStyle: Google
IndentWidth: 4
Expand Down Expand Up @@ -56,4 +55,3 @@ SpaceInEmptySquareBrackets: true
SpaceInEmptyBlock: true

ColumnLimit: 140
---
58 changes: 58 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Clang-Format Check and Fix

on:
push:
branches:
- develop

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 2
persist-credentials: true

- name: Install Clang-Format
run: sudo apt-get install -y clang-format

- name: Display Clang-Format Version
run: clang-format --version

- name: Identify Changed Files in Push
run: |
echo "Changed files in push:"
git diff --name-only --diff-filter=ACM "${{ github.event.before }}" "${{ github.sha }}" | grep -E '\.(cpp|hpp|c|h)$' || echo "No matching files changed."
- name: Run Clang-Format on Changed Files
run: |
git diff --name-only --diff-filter=ACM "${{ github.event.before }}" "${{ github.sha }}" | grep -E '\.(cpp|hpp|c|h)$' | xargs -r clang-format -style=file -i
- name: Check for Formatting Differences
id: check_diff
run: |
# This command will exit with a non-zero status if there are differences.
git diff --exit-code
continue-on-error: true

- name: Auto-commit Formatting Changes
if: failure()
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Apply clang-format"
# Strip the "refs/heads/" prefix to get the branch name.
branch=${GITHUB_REF#refs/heads/}
git push origin HEAD:"$branch"
- name: Report Success or Failure
run: |
if [ "${{ steps.check_diff.outcome }}" == "failure" ]; then
echo "Formatting issues were detected and fixed."
else
echo "Code is properly formatted."
fi
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void checkValidityOfRequiredEnvironmentUpdates(
for( unsigned int i = 0; i < updateIterator->second.size( ); i++ )
{
// Ignore global required updates.
if( updateIterator->second.at( i ) != "" )
if( updateIterator->second.at( i ) != "" )
{
// Check if body exists.
if( bodies.count( updateIterator->second.at( i ) ) == 0 )
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.14.0.dev1
2.14.0.dev2

0 comments on commit 52e039f

Please sign in to comment.