{
  "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
    },
    "source": [
      {
        "id": "help",
        "kind": "help",
        "revision": "shellcheck --help (0.11)",
        "evidence": "Usage: shellcheck [OPTIONS...] FILES...\n  -a                  --check-sourced            Include warnings from sourced files\n  -i CODE1,CODE2..    --include=CODE1,CODE2..    Consider only given types of warnings\n  -e CODE1,CODE2..    --exclude=CODE1,CODE2..    Exclude types of warnings\n                      --list-optional            List checks disabled by default\n                      --norc                     Don't look for .shellcheckrc files\n  -o check1,check2..  --enable=check1,check2..   List of optional checks to enable (or 'all')\n  -s SHELLNAME        --shell=SHELLNAME          Specify dialect (sh, bash, dash, ksh, busybox)\n  -S SEVERITY         --severity=SEVERITY        Minimum severity of errors to consider (error, warning, info, style)\n  -f FORMAT           --format=FORMAT            Output format (checkstyle, diff, gcc, json, json1, quiet, tty)\n  -x                  --external-sources         Allow 'source' outside of FILES\n"
      }
    ],
    "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"
        ]
      },
      {
        "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"
        ]
      },
      {
        "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"
        ]
      },
      {
        "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"
        ]
      },
      {
        "id": "exclude",
        "label": "Exclude codes",
        "description": "Comma-separated warning codes, for example SC2086,SC2164.",
        "type": "string",
        "option": [
          "--exclude",
          "-e"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "include",
        "label": "Only these codes",
        "description": "Comma-separated warning codes to consider.",
        "type": "string",
        "option": [
          "--include",
          "-i"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "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"
        ]
      },
      {
        "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"
        ]
      },
      {
        "id": "check_sourced",
        "label": "Include sourced warnings",
        "type": "boolean",
        "option": [
          "--check-sourced",
          "-a"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "norc",
        "label": "Ignore .shellcheckrc",
        "type": "boolean",
        "option": [
          "--norc"
        ],
        "sources": [
          "help"
        ]
      }
    ],
    "task": [
      {
        "id": "lint",
        "label": "Lint scripts",
        "fields": [
          "files",
          "shell",
          "severity",
          "exclude"
        ],
        "required": [
          "files"
        ]
      },
      {
        "id": "follow",
        "label": "Lint following sourced files",
        "set": {
          "external_sources": [
            true
          ]
        },
        "fields": [
          "files",
          "shell",
          "external_sources",
          "check_sourced"
        ],
        "required": [
          "files"
        ]
      },
      {
        "id": "json",
        "label": "Machine-readable output",
        "set": {
          "format": [
            "json"
          ]
        },
        "lock": [
          "format"
        ],
        "fields": [
          "files",
          "format",
          "shell",
          "severity"
        ],
        "required": [
          "files"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "files",
          "shell",
          "severity",
          "exclude",
          "format"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "include",
          "enable",
          "external_sources",
          "check_sourced",
          "norc"
        ]
      }
    ]
  }
}
