A Woodpecker CI plugin for shellsheck to lint shell files. Also usable with Gitlab, Github or locally, see examples for usage.
- preconfigure Shellcheck parameters
- searches for shell files recursive
- runnable with local docker daemon
Woodpecker:
steps:
shellcheck:
image: kokuwaio/shellcheck
depends_on: []
settings:
shell: bash
severity: error
when:
event: pull_request
path: "**/*.sh"
Gitlab:
shellcheck:
stage: lint
needs: []
image: kokuwaio/shellcheck
variables:
PLUGIN_SHELL: bash
PLUGIN_SEVERITY: error
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes: ["**/*.sh"]
CLI:
docker run --rm --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/shellcheck --shell=bash --severity=error
Settings Name | Environment | Default | Description |
---|---|---|---|
shell |
PLUGIN_SHELL | none |
Specify dialect (sh, bash, dash, ksh, busybox) |
severity |
PLUGIN_SEVERITY | style |
Minimum severity of errors to consider (error, warning, info, style) |
include |
PLUGIN_INCLUDE | none |
Consider only given types of warnings |
exclude |
PLUGIN_EXCLUDE | none |
Exclude types of warnings |
color |
PLUGIN_COLOR | none |
Use color (auto, always, never) |
format |
PLUGIN_FORMAT | tty |
Output format (checkstyle, diff, gcc, json, json1, quiet, tty) |
Image | Comment | amd64 | arm64 |
---|---|---|---|
kokuwaio/shellcheck | Woodpecker plugin | ||
koalaman/shellcheck | not a Woodpecker plugin, official | ||
pipelinecomponents/shellcheck | not a Woodpecker plugin |