mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Expand with info how to pass ignore rules when running shellcheck in Docker.
14
Ignore.md
14
Ignore.md
@@ -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:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user