Skip to content

Commit

Permalink
PR #746 from me: document test suite dependency on ShellCheck (closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
reidpr committed Jun 22, 2020
1 parent 672b5c3 commit 8948960
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
11 changes: 10 additions & 1 deletion configure.ac
Expand Up @@ -306,6 +306,13 @@ EOF
AC_MSG_RESULT($have_requests)
])

# ShellCheck
vmin_shellcheck=0.6.0
AC_CHECK_PROG([SHELLCHECK], [shellcheck], [shellcheck])
# https://stackoverflow.com/questions/6022384
CH_CHECK_VERSION([SHELLCHECK], [$vmin_shellcheck],
[--version | sed -n '2{s/^version: //;p;q}'])

# SquashFUSE
vmin_squashfuse=0.1.100 # Ubuntu 16.04 (Xenial). CentOS 7 has 0.1.102.
AC_CHECK_PROG([SQUASHFUSE], [squashfuse], [squashfuse])
Expand Down Expand Up @@ -473,7 +480,8 @@ AS_IF([ test $have_tests_tar = yes \

# assumes we do have generic sudo
AS_IF([ test $have_tests_squash = yes \
&& test -n "$SPHINX"],
&& test -n "$SPHINX" \
&& test -n "$SHELLCHECK"],
[have_tests_all=yes],
[have_tests_all=no])

Expand Down Expand Up @@ -610,5 +618,6 @@ Test suite
complete test suite: ${have_tests_all}
recommended tests with SquashFS ... ${have_tests_squash}
documentation ... ${have_docs}
ShellCheck ≥ $vmin_shellcheck ... ${SHELLCHECK_VERSION_NOTE}
generic sudo ... assumed yes
])
13 changes: 13 additions & 0 deletions doc/install.rst
Expand Up @@ -387,6 +387,19 @@ Python
We use Python for scripts that would be really hard to do in Bash, when we
think Python is likely to be available.

ShellCheck
~~~~~~~~~~

`ShellCheck <https://www.shellcheck.net/>`_ is a very thorough and capable
linter for shell scripts. In order to pass the full test suite, all the shell
scripts need to pass ShellCheck.

While it is widely available in distributions, the packaged version is usually
too old. Building from source is tricky because it's a Haskell program, which
isn't a widely available tool chain. Fortunately, the developers provide
pre-compiled `static binaries
<https://github.com/koalaman/shellcheck/releases>`_ on their GitHub page.

Sphinx
~~~~~~

Expand Down

0 comments on commit 8948960

Please sign in to comment.