Fix clang-format (#1150)

* Fix clang-format

* Add back format.yml

* Remove python format
This commit is contained in:
Christian Semmler 2024-11-14 13:53:13 -07:00 committed by GitHub
parent 71a7498481
commit db502fcbda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 4 deletions

19
.github/workflows/format.yml vendored Normal file
View file

@ -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

View file

@ -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)) {