Skip to content

Commit

Permalink
Merge pull request #234 from limbonaut/doc-fixes
Browse files Browse the repository at this point in the history
GHA: Code style checks for PRs and commits
  • Loading branch information
limbonaut authored Oct 13, 2024
2 parents 19d771f + 8578761 commit ece17d6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ jobs:
run: |
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/[email protected]
with:
extra_args: --all-files

cache-env:
runs-on: ubuntu-latest
outputs:
Expand Down
3 changes: 1 addition & 2 deletions editor/limbo_ai_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 (tab_search_context.has(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());
}
}
Expand Down
2 changes: 1 addition & 1 deletion register_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@
#include "editor/debugger/limbo_debugger.h"
#include "editor/debugger/limbo_debugger_plugin.h"
#include "editor/mode_switch_button.h"
#include "editor/tree_search.h"
#include "hsm/limbo_hsm.h"
#include "hsm/limbo_state.h"
#include "util/limbo_string_names.h"
#include "util/limbo_task_db.h"
#include "util/limbo_utility.h"
#include "editor/tree_search.h"

#ifdef TOOLS_ENABLED
#include "editor/debugger/behavior_tree_view.h"
Expand Down
13 changes: 7 additions & 6 deletions util/limbo_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ using namespace godot;
#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 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. */\
EditorInterface::get_singleton()->get_editor_settings()->set_initial_value(m_setting, m_value, false); \
if (!EDITOR_SETTINGS()->has_setting(m_setting)) { \
EDITOR_SETTINGS()->set_setting(m_setting, m_value); \
} \
} while(0)
#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); \
if (!EDITOR_SETTINGS()->has_setting(m_setting)) { \
EDITOR_SETTINGS()->set_setting(m_setting, m_value); \
} \
} while (0)

_FORCE_INLINE_ bool OBJECT_HAS_PROPERTY(Object *p_obj, const StringName &p_prop) {
return Variant(p_obj).has_key(p_prop);
Expand Down

0 comments on commit ece17d6

Please sign in to comment.