Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f70686c

Browse files
committedNov 14, 2024··
CI: Integrate pre-commit for style checks
1 parent 5338ea5 commit f70686c

File tree

12 files changed

+30
-62
lines changed

12 files changed

+30
-62
lines changed
 

‎.github/workflows/ci.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,11 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v4
1717

18-
- name: Install dependencies
19-
run: |
20-
# Install tools used by `_tools/format.sh`.
21-
sudo apt-get -qq update
22-
sudo apt-get -qq install dos2unix recode
23-
sudo pip3 install -r requirements.txt
24-
sudo pip3 install codespell
25-
26-
- name: Linter checks
27-
run: |
28-
bash _tools/format.sh
18+
- name: Style checks via pre-commit
19+
uses: pre-commit/action@v3.0.1
2920

30-
codespell -D- -D _tools/codespell-dict.txt -I _tools/codespell-ignore.txt -x _tools/codespell-ignore-lines.txt -S tutorials/i18n/locales.rst {about,community,contributing,getting_started,tutorials}/{*.rst,**/*.rst,**/**/*.rst,**/**/**/*.rst}
21+
- name: Install dependencies
22+
run: sudo pip3 install -r requirements.txt
3123

3224
# Use dummy builder to improve performance as we don't need the generated HTML in this workflow.
3325
- name: Sphinx build

‎.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
default_language_version:
2+
python: python3
3+
4+
repos:
5+
- repo: https://github.com/codespell-project/codespell
6+
rev: v2.3.0
7+
hooks:
8+
- id: codespell
9+
files: ^(about|community|contributing|getting_started|tutorials)/.*\.rst$
10+
additional_dependencies: [tomli]
11+
12+
- repo: https://github.com/pre-commit/pre-commit-hooks
13+
rev: v5.0.0
14+
hooks:
15+
- id: end-of-file-fixer
16+
- id: fix-byte-order-marker
17+
- id: mixed-line-ending
18+
args: ['--fix=lf']

‎_tools/format.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

‎classes/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,4 +1085,3 @@ Variant types
10851085
class_vector3i
10861086
class_vector4
10871087
class_vector4i
1088-

‎contributing/how_to_contribute.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,3 @@ Community support
108108
Chances are you looked for learning materials outside of what the documentation provides.
109109
Without content creators covering the game development process, there would not be this big of a community today.
110110
Therefore it seemed only right to mention them in a page about important contributions to the project.
111-

‎getting_started/introduction/first_look_at_the_editor.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,3 @@ Alternatively,
181181
or built-in variable in the script editor.
182182
* Right-clicking on nodes and choosing **Open Documentation** or choosing **Lookup Symbol**
183183
for elements in script editor will directly open their documentation.
184-

‎pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[tool.ruff]
2+
line-length = 120
3+
4+
[tool.codespell]
5+
dictionary = ["_tools/codespell-dict.txt", "-"]
6+
ignore-words = "_tools/codespell-ignore.txt"
7+
exclude-file = "_tools/codespell-ignore-lines.txt"
8+
skip = "tutorials/i18n/locales.rst"

‎tutorials/assets_pipeline/escn_exporter/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ is not maintained or supported in Godot 4.x. While not officially supported, the
1111
partially work for some Godot and Blender versions, particularly before Blender version 4.0.
1212
For complete docs on the Blender exporter, see the
1313
`previous version of this page <https://docs.godotengine.org/en/4.0/tutorials/assets_pipeline/escn_exporter/index.html>`__.
14-

‎tutorials/editor/external_editor.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,3 @@ Emacs
119119
^^^^^
120120

121121
Check the official instructions to configure `LSP <https://github.com/godotengine/emacs-gdscript-mode#auto-completion-with-the-language-server-protocol-lsp>`_, and `DAP <https://github.com/godotengine/emacs-gdscript-mode#using-the-debugger>`_.
122-

‎tutorials/navigation/navigation_using_navigationmeshes.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,4 +694,3 @@ The following script uses the NavigationServer to update a navigation region wit
694694
NavigationServer3D.RegionSetNavigationMesh(_regionRid, _navigationMesh);
695695
}
696696
}
697-

‎tutorials/scripting/gdextension/gdextension_file.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,3 @@ If no path is supplied Godot will move the libraries into the same directory as
182182
"res://bin/libdependency.linux.template_release.arm64.so" : "",
183183
"res://bin/libdependency.linux.template_release.rv64.so" : ""
184184
}
185-

‎tutorials/xr/xr_action_map.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,4 +385,3 @@ This is why many XR runtimes only use it as a last resort and will attempt to us
385385
This is our advice as well: limit your action map to the interaction profiles for devices you have actually tested your game with.
386386
The Oculus Touch controller is widely used as a fallback controller by many runtimes.
387387
If you are able to test your game using a Meta Rift or Quest and add this profile there is a high probability your game will work with other headsets.
388-

0 commit comments

Comments
 (0)
Please sign in to comment.