Merge pull request #234 from limbonaut/doc-fixes

GHA: Code style checks for PRs and commits
This commit is contained in:
Serhii Snitsaruk 2024-10-13 12:03:17 -07:00 committed by GitHub
commit ece17d68d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 9 deletions

View File

@ -101,6 +101,18 @@ jobs:
run: | run: |
bin/${{ env.BIN }} --test --headless bin/${{ env.BIN }} --test --headless
static-checks:
name: ⚙️ Static checks
runs-on: ubuntu-20.04
steps:
- name: Clone LimboAI module
uses: actions/checkout@v4
- name: Code style checks
uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files
cache-env: cache-env:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:

View File

@ -288,8 +288,7 @@ void LimboAIEditor::edit_bt(const Ref<BehaviorTree> &p_behavior_tree, bool p_for
if (idx_history >= 0 && idx_history < history.size()) { if (idx_history >= 0 && idx_history < history.size()) {
if (tab_search_context.has(history[idx_history])) { if (tab_search_context.has(history[idx_history])) {
task_tree->tree_search_set_search_info(tab_search_context[history[idx_history]]); task_tree->tree_search_set_search_info(tab_search_context[history[idx_history]]);
} } else {
else {
task_tree->tree_search_set_search_info(TreeSearch::SearchInfo()); task_tree->tree_search_set_search_info(TreeSearch::SearchInfo());
} }
} }

View File

@ -101,12 +101,12 @@
#include "editor/debugger/limbo_debugger.h" #include "editor/debugger/limbo_debugger.h"
#include "editor/debugger/limbo_debugger_plugin.h" #include "editor/debugger/limbo_debugger_plugin.h"
#include "editor/mode_switch_button.h" #include "editor/mode_switch_button.h"
#include "editor/tree_search.h"
#include "hsm/limbo_hsm.h" #include "hsm/limbo_hsm.h"
#include "hsm/limbo_state.h" #include "hsm/limbo_state.h"
#include "util/limbo_string_names.h" #include "util/limbo_string_names.h"
#include "util/limbo_task_db.h" #include "util/limbo_task_db.h"
#include "util/limbo_utility.h" #include "util/limbo_utility.h"
#include "editor/tree_search.h"
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
#include "editor/debugger/behavior_tree_view.h" #include "editor/debugger/behavior_tree_view.h"

View File

@ -114,7 +114,8 @@ using namespace godot;
#define ADD_STYLEBOX_OVERRIDE(m_control, m_name, m_stylebox) (m_control->add_theme_stylebox_override(m_name, m_stylebox)) #define ADD_STYLEBOX_OVERRIDE(m_control, m_name, m_stylebox) (m_control->add_theme_stylebox_override(m_name, m_stylebox))
#define GET_NODE(m_parent, m_path) m_parent->get_node_internal(m_path) #define GET_NODE(m_parent, m_path) m_parent->get_node_internal(m_path)
#define OBJECT_DB_GET_INSTANCE(m_id) ObjectDB::get_instance(m_id) #define OBJECT_DB_GET_INSTANCE(m_id) ObjectDB::get_instance(m_id)
#define EDITOR_DEF(m_setting, m_value) do { /* do-while(0) ideom to avoid any potential semicolon errors. */\ #define EDITOR_DEF(m_setting, m_value) \
do { /* do-while(0) ideom to avoid any potential semicolon errors. */ \
EditorInterface::get_singleton()->get_editor_settings()->set_initial_value(m_setting, m_value, false); \ EditorInterface::get_singleton()->get_editor_settings()->set_initial_value(m_setting, m_value, false); \
if (!EDITOR_SETTINGS()->has_setting(m_setting)) { \ if (!EDITOR_SETTINGS()->has_setting(m_setting)) { \
EDITOR_SETTINGS()->set_setting(m_setting, m_value); \ EDITOR_SETTINGS()->set_setting(m_setting, m_value); \