From b47dfb6a5ca1b03091207ee7db562462ac69e2b9 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 2 May 2022 21:13:56 +0200 Subject: [PATCH] [CI] Add python file format to static checks. Uses the same version of `black` as godot. --- .github/workflows/ci.yml | 5 +++++ SConstruct | 2 +- binding_generator.py | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b3b082..b0ab2eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -179,7 +179,12 @@ jobs: sudo apt-get install -qq dos2unix recode clang-format-11 sudo update-alternatives --remove-all clang-format sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-11 100 + python -m pip install black==22.3.0 - name: Style checks via clang-format run: | bash ./misc/scripts/clang_format.sh + + - name: Python style checks via black (black_format.sh) + run: | + bash ./misc/scripts/black_format.sh diff --git a/SConstruct b/SConstruct index 41d1c30..ed352e2 100644 --- a/SConstruct +++ b/SConstruct @@ -81,7 +81,7 @@ else: env = Environment(ENV=os.environ) -is64 = sys.maxsize > 2 ** 32 +is64 = sys.maxsize > 2**32 if ( env["TARGET_ARCH"] == "amd64" or env["TARGET_ARCH"] == "emt64" diff --git a/binding_generator.py b/binding_generator.py index ebfe9d1..7211261 100644 --- a/binding_generator.py +++ b/binding_generator.py @@ -1132,9 +1132,13 @@ def generate_engine_class_source(class_api, used_classes, fully_used_classes, us is_ref = True else: if method["is_static"]: - method_call += f"return internal::_call_native_mb_ret_obj<{return_type}>(___method_bind, nullptr" + method_call += ( + f"return internal::_call_native_mb_ret_obj<{return_type}>(___method_bind, nullptr" + ) else: - method_call += f"return internal::_call_native_mb_ret_obj<{return_type}>(___method_bind, _owner" + method_call += ( + f"return internal::_call_native_mb_ret_obj<{return_type}>(___method_bind, _owner" + ) else: if method["is_static"]: method_call += f"internal::_call_native_mb_no_ret(___method_bind, nullptr"