Skip to content
Permalink
Browse files

tests/shell-checks: add style checks for do/then

  • Loading branch information
austin987 committed Nov 26, 2019
1 parent 6c766e1 commit ac4ca2032620fd38c438d76327214eb93a5034b3
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/shell-checks
@@ -138,6 +138,16 @@ test_formatting() {
if grep -n "$(printf '\t')" "${shellscript}"; then
w_die "${shellscript} contains tabs, please use spaces instead."
fi

# make sure `do` isn't on its own line:
if grep -n -w -e ' do$' -e '^do$' "${shellscript}"; then
w_die "Put 'do' on the same line as 'for/while'"
fi

# make sure `then` isn't on its own line:
if grep -n -w -e ' then$' -e '^then$' "${shellscript}"; then
w_die "Put 'then' on the same line as 'if'"
fi
}

# tests using shellcheck

0 comments on commit ac4ca20

Please sign in to comment.
You can’t perform that action at this time.