forked from godotengine/godot-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
426 additions
and
1,015 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,48 +7,27 @@ concurrency: | |
|
||
jobs: | ||
static-checks: | ||
name: Format (clang-format, black format, file format) | ||
runs-on: ubuntu-20.04 | ||
name: Format (clang-format, ruff format, file format) | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
# Azure repositories are not reliable, we need to prevent Azure giving us packages. | ||
- name: Make apt sources.list use the default Ubuntu repositories | ||
run: | | ||
sudo rm -f /etc/apt/sources.list.d/* | ||
sudo cp -f misc/ci/sources.list /etc/apt/sources.list | ||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" | ||
sudo apt-get update | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install -qq dos2unix recode clang-format-15 libxml2-utils python3-pip moreutils | ||
sudo update-alternatives --remove-all clang-format || true | ||
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-15 100 | ||
sudo pip3 install black==22.3.0 pygments pytest==7.1.2 mypy==0.971 | ||
- name: File formatting checks (file_format.sh) | ||
run: | | ||
bash ./misc/scripts/file_format.sh | ||
- name: Header guards formatting checks (header_guards.sh) | ||
run: | | ||
bash ./misc/scripts/header_guards.sh | ||
- name: Python style checks via black (black_format.sh) | ||
run: | | ||
bash ./misc/scripts/black_format.sh | ||
- name: Python scripts static analysis (mypy_check.sh) | ||
run: | | ||
bash ./misc/scripts/mypy_check.sh | ||
- name: Bindings generation checks (ensures get_file_list returns all generated files) | ||
run: | | ||
python ./misc/scripts/check_get_file_list.py | ||
- name: Style checks via clang-format (clang_format.sh) | ||
run: | | ||
bash ./misc/scripts/clang_format.sh | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Get changed files | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
files=$(git diff-tree --no-commit-id --name-only -r HEAD^1..HEAD 2> /dev/null || true) | ||
elif [ "${{ github.event_name }}" == "push" -a "${{ github.event.forced }}" == "false" -a "${{ github.event.created }}" == "false" ]; then | ||
files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.before }}..${{ github.event.after }} 2> /dev/null || true) | ||
fi | ||
files=$(echo "$files" | grep -v 'thirdparty' | xargs -I {} sh -c 'echo "\"./{}\""' | tr '\n' ' ') | ||
echo "CHANGED_FILES=$files" >> $GITHUB_ENV | ||
- name: Style checks via pre-commit | ||
uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --verbose --hook-stage manual --files ${{ env.CHANGED_FILES }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
include/gen | ||
src/gen | ||
|
||
# Build configuarion. | ||
# Build configuration. | ||
/custom.py | ||
|
||
# Misc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
default_language_version: | ||
python: python3 | ||
|
||
exclude: | | ||
(?x)^( | ||
gdextension/extension_api\.json| | ||
gdextension/gdextension_interface\.h | ||
)$ | ||
repos: | ||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v17.0.6 | ||
hooks: | ||
- id: clang-format | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.4.4 | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.971 | ||
hooks: | ||
- id: mypy | ||
files: \.py$ | ||
types_or: [text] | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
additional_dependencies: [tomli] | ||
|
||
- repo: local | ||
hooks: | ||
- id: copyright-headers | ||
name: copyright-headers | ||
language: python | ||
entry: python misc/scripts/copyright_headers.py | ||
files: \.(c|h)pp$ | ||
exclude: ^test/ | ||
|
||
- id: header-guards | ||
name: header-guards | ||
language: python | ||
entry: python misc/scripts/header_guards.py | ||
files: \.hpp$ | ||
exclude: ^test/ | ||
|
||
- id: file-format | ||
name: file-format | ||
language: python | ||
entry: python misc/scripts/file_format.py | ||
types_or: [text] | ||
|
||
- id: check-get-file-list | ||
name: check-get-file-list | ||
language: python | ||
entry: python misc/scripts/check_get_file_list.py | ||
pass_filenames: false | ||
always_run: true | ||
stages: [manual] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.