id = "shellcheck"
name = "ShellCheck"
homepage = "https://www.shellcheck.net"
description = "ShellCheck is a static analysis and linting tool for sh/bash scripts."
executables = ["shellcheck"]
[dotfiles]
paths = [
"~/.shellcheckrc",
"[configHome]/shellcheckrc",
]
secret = []
side_effect = false
[commands]
format = 1
label = "Check shell scripts"
description = "Lint one or more shell scripts with ShellCheck. Color, wiki-link count, source paths and rc-file overrides are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true }
[[commands.source]]
id = "help"
kind = "help"
revision = "shellcheck --help (0.11)"
evidence = """
Usage: shellcheck [OPTIONS...] FILES...
-a --check-sourced Include warnings from sourced files
-i CODE1,CODE2.. --include=CODE1,CODE2.. Consider only given types of warnings
-e CODE1,CODE2.. --exclude=CODE1,CODE2.. Exclude types of warnings
--list-optional List checks disabled by default
--norc Don't look for .shellcheckrc files
-o check1,check2.. --enable=check1,check2.. List of optional checks to enable (or 'all')
-s SHELLNAME --shell=SHELLNAME Specify dialect (sh, bash, dash, ksh, busybox)
-S SEVERITY --severity=SEVERITY Minimum severity of errors to consider (error, warning, info, style)
-f FORMAT --format=FORMAT Output format (checkstyle, diff, gcc, json, json1, quiet, tty)
-x --external-sources Allow 'source' outside of FILES
"""
[[commands.field]]
id = "files"
label = "Script files"
description = "Use - to read the script from standard input."
type = "path"
position = 0
multiple = true
path = { kind = "file", role = "input", must_exist = true }
sources = ["help"]
[[commands.field]]
id = "shell"
label = "Shell dialect"
description = "Override the dialect instead of using the shebang."
type = "enum"
option = ["--shell", "-s"]
choices = [{ value = "sh", label = "sh" }, { value = "bash", label = "bash" }, { value = "dash", label = "dash" }, { value = "ksh", label = "ksh" }, { value = "busybox", label = "busybox" }]
sources = ["help"]
[[commands.field]]
id = "severity"
label = "Minimum severity"
type = "enum"
option = ["--severity", "-S"]
choices = [{ value = "error", label = "Error" }, { value = "warning", label = "Warning" }, { value = "info", label = "Info" }, { value = "style", label = "Style" }]
sources = ["help"]
[[commands.field]]
id = "format"
label = "Output format"
type = "enum"
option = ["--format", "-f"]
choices = [{ value = "tty", label = "tty" }, { value = "gcc", label = "gcc" }, { value = "checkstyle", label = "Checkstyle" }, { value = "diff", label = "diff" }, { value = "json", label = "JSON" }, { value = "json1", label = "JSON (v1)" }, { value = "quiet", label = "quiet" }]
sources = ["help"]
[[commands.field]]
id = "exclude"
label = "Exclude codes"
description = "Comma-separated warning codes, for example SC2086,SC2164."
type = "string"
option = ["--exclude", "-e"]
sources = ["help"]
[[commands.field]]
id = "include"
label = "Only these codes"
description = "Comma-separated warning codes to consider."
type = "string"
option = ["--include", "-i"]
sources = ["help"]
[[commands.field]]
id = "enable"
label = "Optional checks"
description = "Comma-separated optional checks, or all. See --list-optional."
type = "string"
option = ["--enable", "-o"]
suggestions = [{ value = "all", label = "All optional checks" }]
sources = ["help"]
[[commands.field]]
id = "external_sources"
label = "Follow external sources"
description = "Allow source statements to files outside the checked files."
type = "boolean"
option = ["--external-sources", "-x"]
sources = ["help"]
[[commands.field]]
id = "check_sourced"
label = "Include sourced warnings"
type = "boolean"
option = ["--check-sourced", "-a"]
sources = ["help"]
[[commands.field]]
id = "norc"
label = "Ignore .shellcheckrc"
type = "boolean"
option = ["--norc"]
sources = ["help"]
[[commands.task]]
id = "lint"
label = "Lint scripts"
fields = ["files", "shell", "severity", "exclude"]
required = ["files"]
[[commands.task]]
id = "follow"
label = "Lint following sourced files"
set = { external_sources = [true] }
fields = ["files", "shell", "external_sources", "check_sourced"]
required = ["files"]
[[commands.task]]
id = "json"
label = "Machine-readable output"
set = { format = ["json"] }
lock = ["format"]
fields = ["files", "format", "shell", "severity"]
required = ["files"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["files", "shell", "severity", "exclude", "format"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["include", "enable", "external_sources", "check_sourced", "norc"]