Re-add things that were accidentally removed
This commit is contained in:
parent
65aacbcf2a
commit
25c2bbc80a
11
.gitattributes
vendored
Normal file
11
.gitattributes
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
|
||||
# Ignore some files when exporting.
|
||||
/.github export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/default_env.tres export-ignore
|
||||
/icon.png export-ignore
|
||||
/icon.png.import export-ignore
|
||||
/project.godot export-ignore
|
||||
/README.md export-ignore
|
50
.github/workflows/file_format.sh
vendored
Executable file
50
.github/workflows/file_format.sh
vendored
Executable file
@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script ensures proper POSIX text file formatting and a few other things.
|
||||
|
||||
# We need dos2unix and recode.
|
||||
if [ ! -x "$(command -v dos2unix)" -o ! -x "$(command -v recode)" ]; then
|
||||
printf "Install 'dos2unix' and 'recode' to use this script.\n"
|
||||
fi
|
||||
|
||||
set -uo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Loops through all text files tracked by Git.
|
||||
git grep -zIl '' |
|
||||
while IFS= read -rd '' f; do
|
||||
# Exclude some files.
|
||||
if [[ "$f" == *"csproj"* ]]; then
|
||||
continue
|
||||
fi
|
||||
# Ensure that files are UTF-8 formatted.
|
||||
recode UTF-8 "$f" 2> /dev/null
|
||||
# Ensure that files have LF line endings and do not contain a BOM.
|
||||
dos2unix "$f" 2> /dev/null
|
||||
# Remove trailing space characters and ensures that files end
|
||||
# with newline characters. -l option handles newlines conveniently.
|
||||
perl -i -ple 's/\s*$//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
|
||||
done
|
||||
|
||||
git diff > patch.patch
|
||||
|
||||
# If no patch has been generated all is OK, clean up, and exit.
|
||||
if [ ! -s patch.patch ] ; then
|
||||
printf "Files in this commit comply with the formatting rules.\n"
|
||||
rm -f patch.patch
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# A patch has been created, notify the user, clean up, and exit.
|
||||
printf "\n*** The following differences were found between the code "
|
||||
printf "and the formatting rules:\n\n"
|
||||
cat patch.patch
|
||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||
rm -f patch.patch
|
||||
exit 1
|
19
.github/workflows/static_checks.yml
vendored
Normal file
19
.github/workflows/static_checks.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: 📊 Static Checks
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
format:
|
||||
name: File formatting (file_format.sh)
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -qq dos2unix recode
|
||||
|
||||
- name: File formatting checks (file_format.sh)
|
||||
run: |
|
||||
bash ./.github/workflows/file_format.sh
|
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
|
||||
# Godot-specific ignores
|
||||
.import/
|
||||
|
||||
# Imported translations (automatically generated from CSV files)
|
||||
*.translation
|
||||
|
||||
# Mono-specific ignores
|
||||
.mono/
|
||||
data_*/
|
||||
mono_crash.*.json
|
||||
|
||||
# System/tool-specific ignores
|
||||
.directory
|
||||
*~
|
Binary file not shown.
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 188 B |
Binary file not shown.
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 90 B |
Loading…
x
Reference in New Issue
Block a user