From 21891925ee2c9e13f579ca1892c7e9e29753579f Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Tue, 13 Feb 2024 11:27:07 +1300 Subject: [PATCH] Perform GDScript format checks using pre-commit --- .github/workflows/main.yml | 12 +++--------- .pre-commit-config.yaml | 5 +++++ requirements.txt | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 requirements.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de0faa2..81f66a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -302,15 +302,9 @@ jobs: exit 1 fi - check-code-format: - name: "Check Code Format" + check-pre-commit: + name: "Check Pre-Commit" runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.9 - - name: GDFormat Check - run: | - python -m pip install -r requirements.txt - gdformat -c . + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fec2f45..befc4e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,3 +13,8 @@ repos: rev: v3.1.0 hooks: - id: prettier + - repo: https://github.com/Scony/godot-gdscript-toolkit + rev: 3.5.0 + hooks: + - id: gdformat + exclude: "^addons/gut/" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a733b06..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -gdtoolkit==3.5.0