Expand with info how to pass ignore rules when running shellcheck in Docker.

Michał Sochoń
2018-05-22 18:40:25 +02:00
parent a691762eff
commit 8a1e6dc024

@@ -23,6 +23,20 @@ Set the `SHELLCHECK_OPTS` variable in your `.bashrc`, `/etc/profile` or equivale
export SHELLCHECK_OPTS="-e SC2059 -e SC2034 -e SC1090" export SHELLCHECK_OPTS="-e SC2059 -e SC2034 -e SC1090"
### Ignoring one or more type of error with shellcheck in Docker
Pass it to Docker directly:
docker run -e SHELLCHECK_OPTS="-e SC2059 -e SC2034 -e SC1090" -v "$PWD:/mnt" koalaman/shellcheck myscript
Set the `SHELLCHECK_OPTS` variable in shell:
export SHELLCHECK_OPTS="-e SC2059 -e SC2034 -e SC1090"
and then pass it to Docker:
docker run -e SHELLCHECK_OPTS="$SHELLCHECK_OPTS" -v "$PWD:/mnt" koalaman/shellcheck myscript
### Ignoring all instances in a file (0.4.4+) ### Ignoring all instances in a file (0.4.4+)
Add a [[directive]] at the top of the file: Add a [[directive]] at the top of the file: