From: Daniel Arndt Date: Thu, 16 Jan 2020 17:17:46 +0000 (-0700) Subject: Add script X-Git-Tag: v9.2.0-rc1~656^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9351%2Fhead;p=dealii.git Add script --- diff --git a/contrib/utilities/indent b/contrib/utilities/indent index 0034b4db1a..aa6a54201a 100755 --- a/contrib/utilities/indent +++ b/contrib/utilities/indent @@ -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 diff --git a/contrib/utilities/indent-all b/contrib/utilities/indent-all index 0f4e5b3fa1..b5d5450d91 100755 --- a/contrib/utilities/indent-all +++ b/contrib/utilities/indent-all @@ -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 diff --git a/contrib/utilities/indent_common.sh b/contrib/utilities/indent_common.sh index 43b3eaeb30..d9c82e72d9 100644 --- a/contrib/utilities/indent_common.sh +++ b/contrib/utilities/indent_common.sh @@ -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,