Skip to content

Commit

Permalink
Add code style lint and gdformat.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Feb 8, 2025
1 parent f9bd98b commit bc7779f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/code_style.yaml
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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]

0 comments on commit bc7779f

Please sign in to comment.