Skip to content

Commit e0b948e

Browse files
authored
Added github lint checks (#5)
* feat: ci checks * fix: cspell version number * fix: cspell config path * fix: grammar * chore: fix linting warning * fix: linting
1 parent 45fd850 commit e0b948e

35 files changed

+459
-151
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Runs on non-game files for:
2+
# - Push to master/main
3+
# - Pull requests to master/main/dev
4+
name: Generic CI
5+
6+
on:
7+
push:
8+
branches: ['master', 'main']
9+
paths:
10+
- '**'
11+
- '!game/**' # Excludes game directory
12+
pull_request:
13+
branches: ['master', 'main', 'dev']
14+
paths:
15+
- '**'
16+
- '!game/**' # Excludes game directory
17+
18+
jobs:
19+
spellcheck:
20+
name: 'Spellcheck'
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
# Runs spellcheck using cspell
27+
# Requires cspell.json in root directory
28+
- name: Check spelling
29+
uses: streetsidesoftware/cspell-action@v6
30+
with:
31+
# See https://github.com/streetsidesoftware/cspell-action?tab=readme-ov-file#usage
32+
config: '.vscode/cspell.json'
33+
incremental_files_only: false # Check all files, not just changed ones
34+
root: '.'
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Runs on game directory files for:
2+
# - Push to master/main
3+
# - Pull requests to master/main/dev
4+
name: Godot CI
5+
6+
on:
7+
push:
8+
branches: ['master', 'main']
9+
paths:
10+
- 'game/**' # Only runs when game files change
11+
pull_request:
12+
branches: ['master', 'main', 'dev']
13+
paths:
14+
- 'game/**' # Only runs when game files change
15+
16+
jobs:
17+
spell-check:
18+
name: 'Spellcheck'
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: streetsidesoftware/cspell-action@v6
23+
with:
24+
config: '.vscode/cspell.json'
25+
incremental_files_only: false
26+
root: './game'
27+
28+
# Formatting check
29+
format-check:
30+
name: 'GDScript Formatting Check'
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
36+
# Install GDScript toolkit for formatting
37+
- name: Setup GDScript toolkit
38+
uses: Scony/godot-gdscript-toolkit@4.2.0
39+
40+
# Run formatting check
41+
- name: Check formatting
42+
run: |
43+
cd game
44+
gdformat --check ./
45+
46+
# Linting check
47+
lint-check:
48+
name: 'GDScript Linting Check'
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
# Install GDScript toolkit for linting
55+
- name: Setup GDScript toolkit
56+
uses: Scony/godot-gdscript-toolkit@4.2.0
57+
58+
# Run linting check
59+
- name: Run linting
60+
run: |
61+
cd game
62+
gdlint ./
63+
64+
# Runs visual tests with specific graphics drivers
65+
visual-tests:
66+
name: 'Visual Tests (${{ matrix.render-driver }})'
67+
runs-on: ubuntu-latest
68+
# Prevents duplicate workflows on PRs from same repository
69+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
70+
env:
71+
DOTNET_CLI_TELEMETRY_OPTOUT: true
72+
DOTNET_NOLOGO: true
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
render-driver: [vulkan] # Can add opengl3 if needed
77+
steps:
78+
# Checkout with LFS and submodules
79+
- name: Checkout code
80+
uses: actions/checkout@v4
81+
with:
82+
lfs: true
83+
submodules: 'recursive'
84+
85+
# Setup .NET environment
86+
- name: Setup .NET
87+
uses: actions/setup-dotnet@v4.0.0
88+
with:
89+
global-json-file: global.json
90+
91+
- name: Restore dependencies
92+
run: dotnet restore
93+
94+
# Setup graphics drivers
95+
- name: Add graphics repositories
96+
run: |
97+
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
98+
sudo add-apt-repository -n ppa:kisak/kisak-mesa
99+
100+
# Install and cache graphics packages
101+
- name: Install graphics drivers
102+
uses: awalsh128/cache-apt-pkgs-action@v1.4.1
103+
with:
104+
packages: mesa-vulkan-drivers binutils
105+
version: 1.0
106+
107+
# Setup Godot environment
108+
- name: Setup Godot
109+
uses: chickensoft-games/setup-godot@v2.0.0
110+
with:
111+
version: global.json
112+
113+
# Generate C# bindings
114+
- name: Generate .NET Bindings
115+
working-directory: ./game
116+
run: godot --headless --build-solutions --quit || exit 0
117+
118+
# Run the actual tests
119+
- name: Run Tests
120+
working-directory: ./game
121+
run: |
122+
xvfb-run godot --audio-driver Dummy --rendering-driver ${{ matrix.render-driver }} --run-tests --quit-on-finish --coverage

.vscode/cspell.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3+
"version": "0.2",
4+
"dictionaries": ["softwareTerms"],
5+
"ignorePaths": [
6+
"**/*.tscn",
7+
"**/*.import",
8+
"**/*.godot/**/*.*",
9+
"**/*.tres",
10+
"**/*.svg",
11+
"**/*.tmp",
12+
"**/*project.godot",
13+
"**/*node_modules",
14+
"**/*dist",
15+
"**/*export_presets.cfg"
16+
],
17+
"words": [
18+
"clampi",
19+
"elif",
20+
"NPCS",
21+
"onready",
22+
"randf",
23+
"roundi",
24+
"tilemap",
25+
"tscn",
26+
"unfocus",
27+
"webp",
28+
"wrapi",
29+
"printerr",
30+
"huggingface",
31+
"nerijs",
32+
"stabilityai",
33+
"lefthook",
34+
"gdtoolkit",
35+
"gdlintrc",
36+
"gameplay",
37+
"gdlint",
38+
"gdformat",
39+
"tilesets",
40+
"webgl",
41+
"dalle",
42+
"elevenlabs",
43+
"ollama",
44+
"sfxs",
45+
"vsync",
46+
"borderless",
47+
"unparent",
48+
"equipable",
49+
"chestplate",
50+
51+
"predelete",
52+
"stylebox",
53+
"hbox",
54+
"unequip",
55+
"pixelmix",
56+
"astar",
57+
"darkmode",
58+
"setuptools",
59+
"embedder",
60+
"startfile",
61+
// Godot terms
62+
"gdscript",
63+
"orangered",
64+
"clampf",
65+
"aabb",
66+
"deadzone",
67+
"lerp",
68+
"snappedf",
69+
70+
// Maybe rename
71+
"iconify",
72+
"daynightcycle",
73+
"pathfinding",
74+
"rects",
75+
"autosplit",
76+
"unstreched",
77+
"autosplitmerge",
78+
"protoset",
79+
"weakref",
80+
"knockback",
81+
"unstringify",
82+
"unparented",
83+
"pushable",
84+
"prewritten",
85+
86+
// in-game terms
87+
"bearly",
88+
"aikami",
89+
"halfling",
90+
"dragonborn",
91+
"tiefling",
92+
"baldur",
93+
"debuffs",
94+
"cooldown",
95+
"cooldowns",
96+
97+
// names
98+
"Sauron",
99+
"Aragorn",
100+
"Rohan",
101+
"Gondor",
102+
"Arwen"
103+
]
104+
}

bun.lockb

41.2 KB
Binary file not shown.

docs/linting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Common linting problems
22

3-
- If gdlint/gdformat crashes
3+
- If gdlint/gdformat crashes
44

55
`AttributeError: 'PatternStr' object has no attribute 'raw'`
66

@@ -11,7 +11,7 @@ It might be because you are using lambda function directly like this:
1111
```python
1212

1313
test.connect(func()->void:
14-
if statment:
14+
if statement:
1515
return x
1616
)
1717

docs/project_structure_overview.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,36 +36,36 @@ This document outlines the structure of our project, detailing the purpose of ea
3636

3737
The `ai` directory contains all artificial intelligence-related scripts and models. It is organized into subcategories for different AI functionalities:
3838

39-
- **Image**: For AI that deals with image processing and generation.
40-
- **Text**: Contains models and scripts for text analysis, generation, and understanding.
41-
- **Voice**: For voice recognition and generation AI components.
39+
- **Image**: For AI that deals with image processing and generation.
40+
- **Text**: Contains models and scripts for text analysis, generation, and understanding.
41+
- **Voice**: For voice recognition and generation AI components.
4242

4343
These components utilize various technologies, including Hugging Face's transformers, custom Python scripts, and other machine learning tools. Right now this is only used to create static assets for the game folder, but this might also be expanded to create custom models that will be used in the game.
4444

4545
### Game (`/game`)
4646

4747
The `game` directory houses all the Godot project files, scripts (GDScript), and assets. It is structured as follows to organize different types of game content:
4848

49-
- **Audio**: Contains all audio files, including music and sound effects (SFX), organized further into `music` and `sfx`.
50-
- **Engine**: Scripts that form the game's engine, including APIs, managers (for dialogues, scenes, etc.), and utilities.
51-
- **Entities**: Game entities like NPCs and the player character, including their scripts, scenes, and assets.
52-
- **Maps**: Game levels and maps, including base maps and specific scenes.
53-
- **Models**: Data models used within the game, such as character models, item definitions, and other game logic-related structures.
54-
- **UI**: User interface components, including dialogue boxes, menus, and theming resources.
49+
- **Audio**: Contains all audio files, including music and sound effects (SFX), organized further into `music` and `sfx`.
50+
- **Engine**: Scripts that form the game's engine, including APIs, managers (for dialogues, scenes, etc.), and utilities.
51+
- **Entities**: Game entities like NPCs and the player character, including their scripts, scenes, and assets.
52+
- **Maps**: Game levels and maps, including base maps and specific scenes.
53+
- **Models**: Data models used within the game, such as character models, item definitions, and other game logic-related structures.
54+
- **UI**: User interface components, including dialogue boxes, menus, and theming resources.
5555

5656
### Landing-page (`/landing-page`)
5757

58-
The `landing-page` is the ladning page for the game on `https://bearlysleeping.com`. It uses Astro and tailwind. The landing page get's auto updated every time a new release is pushed with github workflow actions.
58+
The `landing-page` is the landing page for the game on `https://bearlysleeping.com`. It uses Astro and tailwind. The landing page get's auto updated every time a new release is pushed with github workflow actions.
5959

6060
### Docs (`/docs`)
6161

6262
The `docs` directory contains all project documentation. This includes developer guides, project overviews, and any additional documentation related to project setup, deployment, and usage instructions.
6363

6464
### Additional Directories
6565

66-
- **`.github`**: Contains GitHub-specific configurations, including workflows for CI (Continuous Integration).
67-
- **`lefthook.yml`**: Configuration file for Lefthook, used to manage Git hooks for actions like pre-commit checks.
68-
- **`LICENSE`**: The project's license file.
66+
- **`.github`**: Contains GitHub-specific configurations, including workflows for CI (Continuous Integration).
67+
- **`lefthook.yml`**: Configuration file for Lefthook, used to manage Git hooks for actions like pre-commit checks.
68+
- **`LICENSE`**: The project's license file.
6969

7070
## Summary
7171

game/.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,10 @@ $RECYCLE.BIN/
378378
*.msm
379379
*.msp
380380
*.lnk
381-
*.generated.props
381+
*.generated.props
382+
383+
!.vscode/tasks.json
384+
!.vscode/launch.json
385+
!.vscode/extensions.json
386+
!.vscode/settings.json
387+
!.vscode/cspell.json

game/.vscode/cspell.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3+
"version": "0.2",
4+
"import": [
5+
"../../.vscode/cspell.json",
6+
"../.vscode/cspell.json",
7+
".vscode/cspell.json",
8+
"./cspell.json"
9+
],
10+
}

game/.vscode/settings.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,4 @@
77
}
88
]
99
},
10-
"cSpell.words": [
11-
"chestplate",
12-
"clampi",
13-
"elif",
14-
"NPCS",
15-
"onready",
16-
"randf",
17-
"roundi",
18-
"tilemap",
19-
"tscn",
20-
"unfocus",
21-
"webp",
22-
"wrapi"
23-
]
2410
}

0 commit comments

Comments
 (0)