File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,20 @@ function usage() {
2525 echo >&2 " $0 -[f|l]"
2626 echo >&2 " "
2727 echo >&2 " Options:"
28- echo >&2 " -f Format source code in place"
28+ echo >&2 " -f Format source code in place (default) "
2929 echo >&2 " -l Lint check without formatting the source code"
3030}
3131
32+ format=true
3233lint=false
33- while getopts " :lh " opt; do
34+ while getopts " :flh " opt; do
3435 case " $opt " in
36+ f)
37+ format=true
38+ lint=false
39+ ;;
3540 l)
41+ format=false
3642 lint=true
3743 ;;
3844 h)
@@ -99,7 +105,7 @@ if "$lint"; then
99105 fi
100106
101107 log " Ran swift-format lint with no errors."
102- else
108+ elif " $format " ; then
103109 " ${SWIFTFORMAT_BIN} " format \
104110 --parallel --recursive --in-place \
105111 " ${REPO} /Sources" " ${REPO} /Tests" \
110116 fi
111117
112118 log " Ran swift-format with no errors."
119+ else
120+ fatal " No actions taken."
113121fi
You can’t perform that action at this time.
0 commit comments