Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Move .gdlintrc and update CodeStyleWorkflow.yml #30

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/.gdlintrc → .gdlintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ comparison-with-itself: null
constant-name: '[A-Z][A-Z0-9]*(_[A-Z0-9]+)*'
duplicated-load: null
enum-element-name: '[A-Z][A-Z0-9]*(_[A-Z0-9]+)*'
enum-name: ([A-Z][a-z0-9]*)+
enum-name: ([A-Z][_a-z0-9]*)+
expression-not-assigned: null
function-argument-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)*
function-arguments-number: 10
Expand All @@ -37,4 +37,4 @@ sub-class-name: _?([A-Z][a-z0-9]*)+
trailing-whitespace: null
unnecessary-pass: null
unused-argument: null
disable: [class-definitions-order, max-file-lines, max-line-length, max-public-methods]
disable: [class-definitions-order, max-file-lines, max-line-length, max-public-methods, no-else-return]
65 changes: 14 additions & 51 deletions .github/workflows/CodeStyleWorkflow.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,23 @@
name: Code style workflow

# Events but only for the master branch
on:
workflow_dispatch:
push:
branches: [ master ]
branches: [ "master" ]
pull_request:
branches: [ master ]
branches: [ "master" ]

jobs:
format:
# The type of runner that the job will run on
static-checks:
name: 'Static checks'
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install gdtoolkit
- name: Format with gdformat
run: |
gdformat --line-length=150 logger.gd
- name: Commit changes from formatting
uses: stefanzweifel/git-auto-commit-action@v4.1.2
with:
commit_message: Apply formatting changes
branch: ${{ github.head_ref }}

lint:
needs: [format]

# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install gdtoolkit
- name: Lint the code with gdlint
run: |
cp './.github/workflows/.gdlintrc' '.'
gdlint logger.gd
echo "Done!"
- uses: actions/checkout@v3
- uses: Scony/godot-gdscript-toolkit@master
- run: echo "# Lint result" >> result
- run: gdlint logger.gd plugin.gd &>> result
continue-on-error: true
- run: echo "# Can files be formatted" >> result
- run: gdformat --check logger.gd plugin.gd &>> result
continue-on-error: true
- run: cat ./result >> $GITHUB_STEP_SUMMARY
SirMoM marked this conversation as resolved.
Show resolved Hide resolved
Loading