]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add script 9351/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 16 Jan 2020 17:17:46 +0000 (10:17 -0700)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 16 Jan 2020 17:53:45 +0000 (10:53 -0700)
contrib/utilities/indent
contrib/utilities/indent-all
contrib/utilities/indent_common.sh

index 0034b4db1a0a68f7c51eafdb25c926f1e7bff280..aa6a54201a796741a0ec2c40d8e6b37d80108b97 100755 (executable)
@@ -68,3 +68,10 @@ process_changed "tests include source examples contrib/python-bindings" \
 
 process_changed "tests include source examples contrib/python-bindings" \
   ".*\.(cc|h|cu|cuh|inst.in|cmake)" dos_to_unix
+
+#
+# Removing trailing whitespace
+#
+
+process_changed "include source examples contrib/python-bindings doc" \
+  ".*\.(cc|h|cu|cuh|html|dox|txt)" remove_trailing_whitespace
index 0f4e5b3fa1c83929addfd9fb339957c16b6737ee..b5d5450d91afae72497327242670708c98128c12 100755 (executable)
@@ -72,3 +72,10 @@ process "tests include source examples contrib/python-bindings" \
 
 process "tests include source examples contrib/python-bindings" \
   ".*\.(cc|h|cu|cuh|inst.in|cmake)" dos_to_unix
+
+#
+# Removing trailing whitespace
+#
+
+process "include source examples contrib/python-bindings doc" \
+  ".*\.(cc|h|cu|cuh|html|dox|txt)" remove_trailing_whitespace
index 43b3eaeb30d0204e2c248f01690090d7eb36c1de..d9c82e72d91692c214500f03a9675dea14e15d30 100644 (file)
@@ -162,6 +162,16 @@ format_file()
 }
 export -f format_file
 
+#
+# Remove trailing whitespace
+#
+
+remove_trailing_whitespace()
+{
+  sed -i 's/\s\+$//g' $1
+}
+export -f remove_trailing_whitespace
+
 #
 # In order to format .inst.in files, we need to replace \{ and \} by a
 # sentinel because clang-format happily strips away the backslash. Further,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.