diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2020-09-23 02:17:14 -0400 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2020-11-16 23:27:44 -0500 |
commit | 66e3060ea193aeb81a627c8cd4478a3547de9830 (patch) | |
tree | 389226d7a427d5798fac294be875f26ac760660e /misc/scripts | |
parent | fbe0386c653615a373e45af1ebe027c83b924d33 (diff) |
Add line removal around braces to the file formatting script
Diffstat (limited to 'misc/scripts')
-rwxr-xr-x | misc/scripts/file_format.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/misc/scripts/file_format.sh b/misc/scripts/file_format.sh index c570ec23a7..0e9db68a90 100755 --- a/misc/scripts/file_format.sh +++ b/misc/scripts/file_format.sh @@ -40,6 +40,13 @@ while IFS= read -rd '' f; do perl -i -ple 's/\s*$//g' "$f" # Remove the character sequence "== true" if it has a leading space. perl -i -pe 's/\x20== true//g' "$f" + + if [[ $(uname) == "Linux" ]] && [[ "$f" != *"xml" ]]; then + # Remove empty lines after the opening brace of indented blocks. + sed -z -i 's/\x7B\x0A\x0A\x09/\x7B\x0A\x09/g' "$f" + # Remove empty lines before the closing brace (in some cases). + sed -z -i 's/\x0A\x0A\x7D/\x0A\x7D/g' "$f" + fi done git diff > patch.patch |