Skip to content

Commit 6b2d99b

Browse files
committed
C#: Add script for fixing whitespaces
1 parent 3c0f04a commit 6b2d99b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

csharp/fix-whitespaces.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
BASEDIR=$(dirname "$0")
2+
3+
cat > "$BASEDIR/reformat.vim" <<"EOF"
4+
:set ff=unix ts=2 et
5+
:retab!
6+
:%s/\r//g
7+
:%s/ \+$//
8+
:wq
9+
EOF
10+
11+
find "$BASEDIR" \( -name "*.ql" -or -name "*.qll" -or -name "*.csv" \) -exec vim -u /dev/null -s reformat.vim {} \;
12+
13+
cat > reformat.vim <<"EOF"
14+
:set ff=unix ts=4 et
15+
:retab!
16+
:%s/\r//g
17+
:%s/ \+$//
18+
:wq
19+
EOF
20+
21+
find "$BASEDIR" \( -name "*.cs" \) -exec vim -u /dev/null -s reformat.vim {} \;
22+
23+
rm "$BASEDIR/reformat.vim"

0 commit comments

Comments
 (0)