summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2021-09-30 13:01:26 +0200
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2022-04-05 08:28:50 +0000
commitf89dff303a1e06b91563d878607b5fb3c9e0cb04 (patch)
treee6624d1d2947608138b13ccdc8d3765ae97cd820 /scripts
parent8537433f24a04423f1b77f190badfc16169add6d (diff)
downloadgstreamer-f89dff303a1e06b91563d878607b5fb3c9e0cb04.tar.gz
gstreamer-sharp: ensure a consitent code format
Use EditorConfig and dotnet-format to ensure a consistent code style. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/983>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check-format-c16
-rwxr-xr-xscripts/format-csharp4
2 files changed, 20 insertions, 0 deletions
diff --git a/scripts/check-format-c b/scripts/check-format-c
new file mode 100755
index 0000000000..61c2b5c1e0
--- /dev/null
+++ b/scripts/check-format-c
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+
+CUR_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+indent --version || true
+
+$CUR_DIR/gst-indent-all
+
+if git diff --quiet -- ':!subprojects/gst-integration-testsuites/medias' .; then
+ echo "Code is properly formatted"
+else
+ git diff --color=always -- ':!subprojects/gst-integration-testsuites/medias' .
+echo 'style diverges, please run gst-indent first'
+ exit 1
+fi
diff --git a/scripts/format-csharp b/scripts/format-csharp
new file mode 100755
index 0000000000..974ce555a4
--- /dev/null
+++ b/scripts/format-csharp
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -e
+
+dotnet-format subprojects/gstreamer-sharp/gstreamer-sharp.sln --include sources/custom/\*.cs $@