From 99c2764d86a3194e2d35e9b17373b1085b10ed1e Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 7 Aug 2024 09:21:27 -0700 Subject: [PATCH 1/7] chore: add ci --- .github/workflows/main.yml | 22 ++++++++++++++++++++++ typos.toml | 6 ++++++ 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 typos.toml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d7d6b2c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,22 @@ +name: main + +on: + pull_request: + merge_group: + +jobs: + typos-check: + name: Typos Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@cfe759ac8dd421e203cc293a373396fbc6fe0d4b # v1.22.7 + + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: greut/eclint-action@v0 + - uses: jidicula/clang-format-action@v4.11.0 + with: { clang-format-version: "18" } diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000..aba31d8 --- /dev/null +++ b/typos.toml @@ -0,0 +1,6 @@ +[files] +extend-exclude = ["CHANGELOG.md"] + +[default] +extend-ignore-re = ["(?Rm)^.*(#|//)\\s*typos:disable-line$"] +extend-ignore-words-re = ["UE"] From 7ab973fd8e9df285dbbfb607c69bc9e89b5c0e5c Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 7 Aug 2024 09:24:50 -0700 Subject: [PATCH 2/7] chore: update indent style --- .editorconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.editorconfig b/.editorconfig index e1fcc81..1240741 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,3 +6,11 @@ insert_final_newline = true indent_size = 4 indent_style = tab +[*.{yml}] +indent_style = space + +[*.{cc,hh,cpp,hpp,h,cpp}] +# matching .clang-format IndentWidth +indent_size = 2 +indent_style = tab + From 5e8cbe3c81fabb491db97f077969e8e87e4b8146 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 7 Aug 2024 09:25:50 -0700 Subject: [PATCH 3/7] chore: update indent style --- .editorconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 1240741..4a34828 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,7 +6,12 @@ insert_final_newline = true indent_size = 4 indent_style = tab -[*.{yml}] +[*.{yml,yaml}] +indent_size = 2 +indent_style = space + +[*.clang-format] +indent_size = 2 indent_style = space [*.{cc,hh,cpp,hpp,h,cpp}] From 23f2860f1f990a97210cd6260e84aebcd929da59 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 7 Aug 2024 09:26:02 -0700 Subject: [PATCH 4/7] chore: update indent style --- .editorconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 4a34828..0e51c5f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,4 +18,3 @@ indent_style = space # matching .clang-format IndentWidth indent_size = 2 indent_style = tab - From 61b49246112ea99c6413b63ad407d2c511875daf Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 7 Aug 2024 09:27:27 -0700 Subject: [PATCH 5/7] chore: formatting --- Source/EcsactEditor/Private/EcsactEditor.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/EcsactEditor/Private/EcsactEditor.cpp b/Source/EcsactEditor/Private/EcsactEditor.cpp index 2444c68..d33ea8b 100644 --- a/Source/EcsactEditor/Private/EcsactEditor.cpp +++ b/Source/EcsactEditor/Private/EcsactEditor.cpp @@ -212,10 +212,11 @@ auto FEcsactEditorModule::RunCodegen() -> void { auto FEcsactEditorModule::RunBuild() -> void { const auto* settings = GetDefault(); - auto ecsact_runtime_path = FPaths::Combine( - FPaths::ProjectDir(), - TEXT("Binaries/Win64/EcsactRuntime.dll") - ); + + auto ecsact_runtime_path = FPaths::Combine( + FPaths::ProjectDir(), + TEXT("Binaries/Win64/EcsactRuntime.dll") + ); auto temp_dir = FPaths::CreateTempFilename(TEXT("EcsactBuild")); auto ecsact_files = GetAllEcsactFiles(); From 167c26d2fe3e68b07698e165c86b991906dd0673 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 7 Aug 2024 09:31:34 -0700 Subject: [PATCH 6/7] chore: formatting --- Source/EcsactEditor/Private/EcsactEditor.cpp | 151 ++++++++++--------- 1 file changed, 77 insertions(+), 74 deletions(-) diff --git a/Source/EcsactEditor/Private/EcsactEditor.cpp b/Source/EcsactEditor/Private/EcsactEditor.cpp index d33ea8b..027b110 100644 --- a/Source/EcsactEditor/Private/EcsactEditor.cpp +++ b/Source/EcsactEditor/Private/EcsactEditor.cpp @@ -291,86 +291,89 @@ auto FEcsactEditorModule::OnReceiveEcsactCliJsonMessage(FString Json) -> void { auto json_object = TSharedPtr{}; auto reader = TJsonReaderFactory<>::Create(Json); - if(FJsonSerializer::Deserialize(reader, json_object) && - json_object.IsValid()) { - auto message_type = json_object->GetStringField(TEXT("type")); - - if(message_type == "info") { - UE_LOG( - EcsactEditor, - Log, - TEXT("%s"), - *json_object->GetStringField(TEXT("content")) - ); - } else if(message_type == "error") { - UE_LOG( - EcsactEditor, - Error, - TEXT("%s"), - *json_object->GetStringField(TEXT("content")) - ); - } else if(message_type == "warning") { - UE_LOG( - EcsactEditor, - Warning, - TEXT("%s"), - *json_object->GetStringField(TEXT("content")) - ); - } else if(message_type == "subcommand_start") { - UE_LOG( - EcsactEditor, - Log, - TEXT("subcommand(%i): %s"), - json_object->GetIntegerField(TEXT("id")), - *json_object->GetStringField(TEXT("executable")) - ); - } else if(message_type == "subcommand_end") { - UE_LOG( - EcsactEditor, - Log, - TEXT("subcommand(%i): exit code %i"), - json_object->GetIntegerField(TEXT("id")), - json_object->GetIntegerField(TEXT("exit_code")) - ); - } else if(message_type == "subcommand_stdout") { - UE_LOG( - EcsactEditor, - Log, - TEXT("subcommand(%i): %s"), - json_object->GetIntegerField(TEXT("id")), - *json_object->GetStringField(TEXT("line")) - ); - } else if(message_type == "subcommand_stderr") { - UE_LOG( - EcsactEditor, - Error, - TEXT("subcommand(%i): %s"), - json_object->GetIntegerField(TEXT("id")), - *json_object->GetStringField(TEXT("line")) - ); - } else if(message_type == "success") { - UE_LOG( - EcsactEditor, - Log, - TEXT("%s"), - *json_object->GetStringField(TEXT("content")) - ); - } else { - UE_LOG( - EcsactEditor, - Warning, - TEXT("Unhandled Message (%s): %s"), - *message_type, - *Json - ); - } - } else { + if(!FJsonSerializer::Deserialize(reader, json_object)) { UE_LOG( EcsactEditor, Error, TEXT("Failed to parse JSON message: %s"), *Json ); + return; + } + if(!json_object.IsValid()) { + return; + } + + auto message_type = json_object->GetStringField(TEXT("type")); + + if(message_type == "info") { + UE_LOG( + EcsactEditor, + Log, + TEXT("%s"), + *json_object->GetStringField(TEXT("content")) + ); + } else if(message_type == "error") { + UE_LOG( + EcsactEditor, + Error, + TEXT("%s"), + *json_object->GetStringField(TEXT("content")) + ); + } else if(message_type == "warning") { + UE_LOG( + EcsactEditor, + Warning, + TEXT("%s"), + *json_object->GetStringField(TEXT("content")) + ); + } else if(message_type == "subcommand_start") { + UE_LOG( + EcsactEditor, + Log, + TEXT("subcommand(%i): %s"), + json_object->GetIntegerField(TEXT("id")), + *json_object->GetStringField(TEXT("executable")) + ); + } else if(message_type == "subcommand_end") { + UE_LOG( + EcsactEditor, + Log, + TEXT("subcommand(%i): exit code %i"), + json_object->GetIntegerField(TEXT("id")), + json_object->GetIntegerField(TEXT("exit_code")) + ); + } else if(message_type == "subcommand_stdout") { + UE_LOG( + EcsactEditor, + Log, + TEXT("subcommand(%i): %s"), + json_object->GetIntegerField(TEXT("id")), + *json_object->GetStringField(TEXT("line")) + ); + } else if(message_type == "subcommand_stderr") { + UE_LOG( + EcsactEditor, + Error, + TEXT("subcommand(%i): %s"), + json_object->GetIntegerField(TEXT("id")), + *json_object->GetStringField(TEXT("line")) + ); + } else if(message_type == "success") { + UE_LOG( + EcsactEditor, + Log, + TEXT("%s"), + *json_object->GetStringField(TEXT("content")) + ); + } else { + UE_LOG( + EcsactEditor, + Warning, + TEXT("Unhandled Message (%s): %s"), + *message_type, + *Json + ); } } From c6876079b2af9e5fbaa1349b16f35ae3d5ea633e Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 7 Aug 2024 09:33:19 -0700 Subject: [PATCH 7/7] chore: formatting --- Source/EcsactEditor/Private/EcsactSettings.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/EcsactEditor/Private/EcsactSettings.cpp b/Source/EcsactEditor/Private/EcsactSettings.cpp index 654021d..a6006dd 100644 --- a/Source/EcsactEditor/Private/EcsactSettings.cpp +++ b/Source/EcsactEditor/Private/EcsactSettings.cpp @@ -2,4 +2,3 @@ UEcsactSettings::UEcsactSettings() { } -