diff --git a/.github/workflows/code_style.yaml b/.github/workflows/code_style.yaml new file mode 100644 index 00000000..cc2b2255 --- /dev/null +++ b/.github/workflows/code_style.yaml @@ -0,0 +1,27 @@ +name: pre-commit + +on: + pull_request: + push: + +jobs: + pre-commit-checks: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install pre-commit + run: pip install pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files + + - name: Check for modifications + run: | + git diff --quiet || (echo "Changes detected after pre-commit run!" && exit 1) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..b55602fa --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +repos: + - repo: local + hooks: + - id: gdlint + name: gdlint + description: "gdlint - linter for GDScript" + entry: gdlint + language: python + language_version: python3 + require_serial: true + types: [gdscript] + + - id: gdformat + name: gdformat + description: "gdformat - formatter for GDScript" + entry: gdformat + language: python + language_version: python3 + require_serial: true + types: [gdscript]