Merge pull request #3 from aaronfranke/formatting

Add a formatting script for GitHub Actions and add GitHub metadata
This commit is contained in:
Ignacio Roldán Etcheverry
2020-07-04 23:03:45 +02:00
committed by GitHub
18 changed files with 117 additions and 13 deletions

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
patreon: godotengine
custom: https://godotengine.org/donate

30
.github/ISSUE_TEMPLATE/bug-report.md vendored Normal file
View File

@@ -0,0 +1,30 @@
---
name: Bug Report
about: Report a bug with the extension.
title: ''
labels: bug
assignees: neikeq
---
<!--
Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot-csharp-visualstudio/issues?q=is%3Aissue
Only submit an issue if it is reproducible with the latest stable Godot version.
-->
**OS/device including version:**
<!-- Specify GPU model and drivers if graphics-related. -->
**Issue description:**
<!-- What happened, what was expected, and what went wrong. -->
**Screenshots of issue:**
<!--
This section is optional.
Drag in an image, or post an image with a link in the form of:
![Alt Text Here](https://pbs.twimg.com/media/DW5AJnZVAAM1805?format=jpg)
-->

View File

@@ -0,0 +1,13 @@
---
name: Feature / Enhancement Request
about: Adding new features or improving existing ones.
title: ''
labels: enhancement
assignees: neikeq
---
<!--
Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot-csharp-visualstudio/issues?q=is%3Aissue
-->

15
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Continuous integration
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Lint extension
run: |
sudo apt-get update -qq
sudo apt-get install -qq dos2unix recode
bash ./format.sh

View File

@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
using Mono.Debugging.Client;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.IO;
using System.Net.Sockets;

View File

@@ -1,4 +1,4 @@
using Mono.Debugging.Soft;
using Mono.Debugging.Soft;
namespace GodotAddin.Debugging
{

View File

@@ -1,4 +1,4 @@
using GodotTools.IdeMessaging;
using GodotTools.IdeMessaging;
using MonoDevelop.Core.Execution;
namespace GodotAddin.Debugging

View File

@@ -1,4 +1,4 @@
using System.Net;
using System.Net;
using Mono.Debugging.Soft;
namespace GodotAddin.Debugging

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using GodotTools.IdeMessaging;

View File

@@ -1,4 +1,4 @@
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Components;
using MonoDevelop.Core;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using MonoDevelop.Core;
namespace GodotAddin

View File

@@ -1,4 +1,4 @@
using Mono.Addins;
using Mono.Addins;
using Mono.Addins.Description;
[assembly: Addin(

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<ExtensionModel>
<Extension path="/MonoDevelop/Debugging/DebuggerEngines">
<DebuggerEngine

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Runtime.InteropServices;
using MonoDevelop.Core;

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
namespace GodotAddin.Utils

44
format.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
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.
if [[ "$f" == *"csproj" ]]; then
continue
elif [[ "$f" == *"hdr" ]]; then
continue
fi
# Ensures that files are UTF-8 formatted.
recode UTF-8 "$f" 2> /dev/null
# Ensures that files have LF line endings.
dos2unix "$f" 2> /dev/null
# Ensures that files do not contain a BOM.
sed -i '1s/^\xEF\xBB\xBF//' "$f"
# Ensures that files end with newline characters.
tail -c1 < "$f" | read -r _ || echo >> "$f";
# Remove trailing space characters.
sed -z -i 's/\x20\x0A/\x0A/g' "$f"
done
git diff > patch.patch
FILESIZE="$(stat -c%s patch.patch)"
MAXSIZE=5
# If no patch has been generated all is OK, clean up, and exit.
if (( FILESIZE < MAXSIZE )); 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