From db502fcbdae2d044e2b3c46ac352a7266100fca2 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 14 Nov 2024 13:53:13 -0700 Subject: [PATCH] Fix clang-format (#1150) * Fix clang-format * Add back format.yml * Remove python format --- .github/workflows/format.yml | 19 +++++++++++++++++++ LEGO1/lego/legoomni/src/entity/legoworld.cpp | 6 ++---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..3f90c44f --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,19 @@ +name: Format + +on: [push, pull_request] + +jobs: + clang-format: + name: 'C++' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run clang-format + run: | + find CONFIG LEGO1 ISLE -iname '*.h' -o -iname '*.cpp' | xargs \ + pipx run "clang-format>=17,<18" \ + --style=file \ + -i + git diff --exit-code \ No newline at end of file diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index f28134e9..88023db9 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -447,8 +447,7 @@ void LegoWorld::Add(MxCore* p_object) m_entityList->Append((LegoEntity*) p_object); } - else if (p_object->IsA("LegoLocomotionAnimPresenter") || p_object->IsA("LegoHideAnimPresenter") || - p_object->IsA("LegoLoopingAnimPresenter")) { + else if (p_object->IsA("LegoLocomotionAnimPresenter") || p_object->IsA("LegoHideAnimPresenter") || p_object->IsA("LegoLoopingAnimPresenter")) { MxPresenterListCursor cursor(&m_animPresenters); if (cursor.Find((MxPresenter*) p_object)) { @@ -502,8 +501,7 @@ void LegoWorld::Remove(MxCore* p_object) ((MxControlPresenter*) p_object)->VTable0x68(TRUE); } } - else if (p_object->IsA("LegoLocomotionAnimPresenter") || p_object->IsA("LegoHideAnimPresenter") || - p_object->IsA("LegoLoopingAnimPresenter")) { + else if (p_object->IsA("LegoLocomotionAnimPresenter") || p_object->IsA("LegoHideAnimPresenter") || p_object->IsA("LegoLoopingAnimPresenter")) { MxPresenterListCursor cursor(&m_animPresenters); if (cursor.Find((MxPresenter*) p_object)) {