C#: Add script for fixing whitespaces

This commit is contained in:
Tom Hvitved
2018-08-03 14:10:22 +02:00
parent 3c0f04ac96
commit 6b2d99b6ac

23
csharp/fix-whitespaces.sh Executable file
View File

@@ -0,0 +1,23 @@
BASEDIR=$(dirname "$0")
cat > "$BASEDIR/reformat.vim" <<"EOF"
:set ff=unix ts=2 et
:retab!
:%s/\r//g
:%s/ \+$//
:wq
EOF
find "$BASEDIR" \( -name "*.ql" -or -name "*.qll" -or -name "*.csv" \) -exec vim -u /dev/null -s reformat.vim {} \;
cat > reformat.vim <<"EOF"
:set ff=unix ts=4 et
:retab!
:%s/\r//g
:%s/ \+$//
:wq
EOF
find "$BASEDIR" \( -name "*.cs" \) -exec vim -u /dev/null -s reformat.vim {} \;
rm "$BASEDIR/reformat.vim"