-
-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1527 from dsnopek/4.2-cherrypicks-6
Cherry-picks for the godot-cpp 4.2 branch - 6th batch
- Loading branch information
Showing
53 changed files
with
742 additions
and
1,104 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = tab | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[{*.py,SConstruct}] | ||
indent_style = space | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
indent_style = space |
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 |
---|---|---|
@@ -1,6 +1,2 @@ | ||
*.c eol=lf | ||
*.cpp eol=lf | ||
*.gd eol=lf | ||
*.tscn eol=lf | ||
*.cfg eol=lf | ||
*.godot eol=lf | ||
# Normalize EOL for all files that Git considers text files | ||
* text=auto eol=lf |
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
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
Oops, something went wrong.