mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-16 13:30:07 +01:00
Tweak CI to more closely match the main repo
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
name: Continuous integration
|
||||
name: Static Checks
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
format:
|
||||
name: File formatting (file_format.sh)
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Lint demo projects
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -qq dos2unix recode
|
||||
bash ./format.sh
|
||||
|
||||
- name: File formatting checks (file_format.sh)
|
||||
run: |
|
||||
bash ./file_format.sh
|
||||
@@ -108,7 +108,7 @@ func check_if_mouse_is_inside_canvas():
|
||||
if mouse_click_start_pos.x > TL_node.global_position.x:
|
||||
if mouse_click_start_pos.y > TL_node.global_position.y:
|
||||
# Make sure the current mouse position is inside the canvas.
|
||||
if is_mouse_in_drawing_area == true:
|
||||
if is_mouse_in_drawing_area:
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script ensures proper POSIX text file formatting and a few other things.
|
||||
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Loops through all text files tracked by Git.
|
||||
git grep -zIl '' |
|
||||
while IFS= read -rd '' f; do
|
||||
# Exclude csproj and hdr files.
|
||||
# Exclude some types of files.
|
||||
if [[ "$f" == *"csproj" ]]; then
|
||||
continue
|
||||
elif [[ "$f" == *"hdr" ]]; then
|
||||
@@ -22,6 +24,18 @@ while IFS= read -rd '' f; do
|
||||
tail -c1 < "$f" | read -r _ || echo >> "$f";
|
||||
# Remove trailing space characters.
|
||||
sed -z -i 's/\x20\x0A/\x0A/g' "$f"
|
||||
# Remove the character sequence "== true" if it has a leading space.
|
||||
sed -z -i 's/\x20== true//g' "$f"
|
||||
# We don't want to change lines around braces in godot/tscn files.
|
||||
if [[ "$f" == *"godot" ]]; then
|
||||
continue
|
||||
elif [[ "$f" == *"tscn" ]]; then
|
||||
continue
|
||||
fi
|
||||
# Disallow empty lines after the opening brace.
|
||||
sed -z -i 's/\x7B\x0A\x0A/\x7B\x0A/g' "$f"
|
||||
# Disallow some empty lines before the closing brace.
|
||||
sed -z -i 's/\x0A\x0A\x7D/\x0A\x7D/g' "$f"
|
||||
done
|
||||
|
||||
git diff > patch.patch
|
||||
@@ -177,5 +177,4 @@ public class Node25D : Node2D, IComparable<Node25D>
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,5 +50,4 @@ public class ShadowMath25D : KinematicBody
|
||||
GlobalTransform = Transform;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user