-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlint.bat
18 lines (14 loc) · 1.29 KB
/
lint.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
git ls-files| grep -e .[as]bp | xargs sed -i -r -e 's/ sub / Sub /I' -e 's/End *Sub/End Sub/I' -e 's/Exit *Sub/ExitSub/I'
git ls-files| grep -e .[as]bp | xargs sed -i -r -e 's/ Function / Function /I' -e 's/End *Function/End Function/I' -e 's/Exit *Sub/ExitFunction/I'
git ls-files| grep -e .[as]bp | xargs sed -i -r -e 's/End *if/endif/I' -e 's/else *if/else if/I' -e 's/ if/ if/Ig' -e 's/then/then/I' -e 's/else/else/Ig'
git ls-files| grep -e .[as]bp | xargs sed -i -r -e 's/[ ]+$//g'
git ls-files| grep -e .[as]bp | xargs sed -i -r -e 's/,[ ]*/, /g'
git ls-files| grep -e .[as]bp | xargs sed -i -e "s/=/ = /g" -e "s/<>/ <> /g" -e "s/= *>/ >= /g" -e "s/> *=/ >= /g" -e "s/< *=/ <= /g" -e "s/= *</ <= /g"
git ls-files| grep -e .[as]bp | xargs sed -i -e "s/DWord/DWord/gI" -e "s/ As Long/ As Long/gI" -e "s/ As / As /gI"
git ls-files| grep -e .[as]bp | xargs sed -i -e "s/sizeof/sizeof/gI" -e "s/Dim /Dim /gI" -e "s/ifdef/ifdef/gI"
git ls-files| grep -e .[as]bp | xargs sed -i -e "s/Exit *Do/ExitDo/gI" -e "s/Exit *For/ExitFor/gI" -e "s/Exit *While/ExitWhile/gI"
@REM ==== FIXUP ====
@REM duplicate whitespace test
@REM convert LF to CRLF (これをしないと大幅にバグる)
@REM ===罫線を復元
git ls-files| grep -e .[as]bp | xargs sed -i -r -e 's/ +/ /g' -e 's/$/\r/g' -e "s/= = /==/g"