docker run -i --rm \
-v "$(pwd)":/workdir \
--name [name] \
gruen\shellcheck file_to_check [options]
The command above will lint file_to_check within the current directory
You can use a docker container to lint files within editors.
For example, with atom-linter and linter-shellcheck create a file called
shellcheck inside your $PATH with the following. (be sure
to make the file executable)
#!/usr/bin/env bash
docker run -i --rm \
-v "$(pwd)":/workdir \
--name shellcheck"$(date +%H%M%S)" \
gruen\shellcheck
NOTICE the name parameter, it uses "$(date +%H%M%S)" to append
a timestamp. This should avoid conflicts when your editor invokes the linter
several times within a very short period
Content type
Image
Digest
Size
50.6 MB
Last updated
over 9 years ago
docker pull gruen/shellcheck