-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add typos checks and corrections Add static check github action Add clang-tidy corrections Use optional initialization for PROPERTY macros
- Loading branch information
1 parent
730fcdb
commit 7b000d1
Showing
56 changed files
with
614 additions
and
148 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,19 @@ | ||
Checks: | ||
- -* | ||
- cppcoreguidelines-pro-type-member-init | ||
- modernize-redundant-void-arg | ||
- modernize-use-bool-literals | ||
- modernize-use-default-member-init | ||
- modernize-use-nullptr | ||
- readability-braces-around-statements | ||
- readability-redundant-member-init | ||
HeaderFileExtensions: ['', h, hh, hpp, hxx, inc] | ||
ImplementationFileExtensions: [c, cc, cpp, cxx] | ||
HeaderFilterRegex: (extension/src/openvic-extension)/ | ||
FormatStyle: file | ||
CheckOptions: | ||
cppcoreguidelines-pro-type-member-init.IgnoreArrays: true | ||
cppcoreguidelines-pro-type-member-init.UseAssignment: true | ||
modernize-use-bool-literals.IgnoreMacros: false | ||
modernize-use-default-member-init.IgnoreMacros: false | ||
modernize-use-default-member-init.UseAssignment: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,9 +27,47 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
static-checks: | ||
name: Code style, file formatting, and docs | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout project | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Install APT dependencies | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: libxml2-utils | ||
|
||
- 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 | ||
echo "$files" >> changed.txt | ||
cat changed.txt | ||
files=$(echo "$files" | 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: --files ${{ env.CHANGED_FILES }} | ||
|
||
- name: Class reference schema checks | ||
run: | | ||
xmllint --noout --schema extension/doc_tools/class.xsd extension/doc_classes/*.xml | ||
build: | ||
runs-on: ${{matrix.os}} | ||
name: ${{matrix.name}} | ||
needs: static-checks | ||
permissions: write-all | ||
strategy: | ||
fail-fast: false | ||
|
@@ -140,7 +178,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: [build] | ||
|
||
name: Peform Godot Debug Checks | ||
name: Perform Godot Debug Checks | ||
steps: | ||
- name: Checkout project | ||
uses: actions/[email protected] | ||
|
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,73 @@ | ||
default_language_version: | ||
python: python3 | ||
|
||
repos: | ||
# Waiting on Hop311 to approve clang-format | ||
# - repo: https://github.com/pre-commit/mirrors-clang-format | ||
# rev: v19.1.3 | ||
# hooks: | ||
# - id: clang-format | ||
# files: \.(c|h|cpp|hpp|inc)$ | ||
# types_or: [text] | ||
# # exclude: | | ||
# # (?x)^( | ||
# # ) | ||
|
||
- repo: https://github.com/pocc/pre-commit-hooks | ||
rev: v1.3.5 | ||
hooks: | ||
- id: clang-tidy | ||
files: \.(c|h|cpp|hpp|inc)$ | ||
args: [--fix, --quiet, --use-color] | ||
types_or: [text] | ||
additional_dependencies: [clang-tidy==19.1.0] | ||
require_serial: true | ||
stages: [manual] # Not automatically triggered, invoked via `pre-commit run --hook-stage manual clang-tidy` | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.7.3 | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
- id: ruff-format | ||
exclude: | | ||
(?x)^( | ||
extension/doc_tools/make_rst.py| | ||
extension/doc_tools/doc_status.py | ||
) | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.13.0 | ||
hooks: | ||
- id: mypy | ||
files: \.py$ | ||
types_or: [text] | ||
|
||
- repo: https://github.com/crate-ci/typos | ||
rev: v1.29.4 | ||
hooks: | ||
- id: typos | ||
exclude: | | ||
(?x)^( | ||
game/assets/localisation/locales/.*| | ||
game/addons/.* | ||
) | ||
- repo: local | ||
hooks: | ||
- id: make-rst | ||
name: make-rst | ||
language: python | ||
entry: python extension/doc_tools/make_rst.py | ||
args: [extension, --dry-run, --color] | ||
pass_filenames: false | ||
files: ^(extension/doc_classes)/.*\.xml$ | ||
|
||
- id: doc-status | ||
name: doc-status | ||
language: python | ||
entry: python extension/doc_tools/doc_status.py | ||
args: [extension/doc_classes] | ||
pass_filenames: false | ||
files: ^(extension/doc_classes)/.*\.xml$ |
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
Submodule openvic-simulation
updated
10 files
Oops, something went wrong.