mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Add script for fixing whitespaces
This commit is contained in:
23
csharp/fix-whitespaces.sh
Executable file
23
csharp/fix-whitespaces.sh
Executable 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"
|
||||
Reference in New Issue
Block a user