[gtksourceview: 7/9] uncrustify: add script to run uncrustify and gcu-lineup-parameters
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview: 7/9] uncrustify: add script to run uncrustify and gcu-lineup-parameters
- Date: Wed, 3 Jan 2018 18:19:29 +0000 (UTC)
commit 35d00e41705597ed5bbea41163b6934e6bb234d5
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Jan 3 18:00:28 2018 +0100
uncrustify: add script to run uncrustify and gcu-lineup-parameters
scripts/apply-gsv-coding-style-no-backup.sh | 27 ++++++++++++++++++++
.../gtksourceview-uncrustify.cfg | 0
2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/scripts/apply-gsv-coding-style-no-backup.sh b/scripts/apply-gsv-coding-style-no-backup.sh
new file mode 100755
index 0000000..2f17351
--- /dev/null
+++ b/scripts/apply-gsv-coding-style-no-backup.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# Attention, this script modifies the input file directly without doing a
+# backup first! Ensure that your changes are saved in a git commit before
+# running this script.
+#
+# The script can modify only one file, to run the script on multiple files GNU
+# Parallel is recommended:
+# ls *.c | parallel ./apply-gsv-coding-style-no-backup.sh
+#
+# You need gcu-lineup-parameters from:
+# https://github.com/swilmet/gnome-c-utils
+#
+# Aligning function prototypes is not working yet, so avoid headers, only *.c
+# files can be processed.
+#
+# The uncrustify config file is not perfect, some options can be tuned over
+# time when using this script and seeing a problem (or the source code can be
+# changed to avoid the problem).
+#
+# This script has not (yet) been run on the GtkSourceView *.c files, it can
+# serve more as a guideline, especially for new files.
+
+input_file=$1
+
+uncrustify --replace --no-backup -c gtksourceview-uncrustify.cfg $input_file
+gcu-lineup-parameters --tabs $input_file
diff --git a/gtksourceview-uncrustify.cfg b/scripts/gtksourceview-uncrustify.cfg
similarity index 100%
rename from gtksourceview-uncrustify.cfg
rename to scripts/gtksourceview-uncrustify.cfg
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]