ShellCheck

A shell script static analysis tool.

Version

0.7.0

Runtime

Debian Stretch

Supported Languages

Shell

Official Documentation

https://github.com/koalaman/shellcheck

YAML Configuration

shellcheck:

  • input:

    Patterns to include in execution and reports.

  • ignore:

    Patterns to exclude from execution and reports.

  • auto-fix:

    N/A

  • config-file:

    N/A

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.25 CPU with 960 MiB RAM.

  • options:

    Below is the list of options that are supported:

    -i CODE1,CODE2..    --include=CODE1,CODE2..    Consider only given types of warnings
    -e CODE1,CODE2..    --exclude=CODE1,CODE2..    Exclude types of warnings
                        --norc                     Don't look for .shellcheckrc files
    -o check1,check2..  --enable=check1,check2..   List of optional checks to enable (or 'all')
    -P SOURCEPATHS      --source-path=SOURCEPATHS  Specify path when looking for sourced files ("SCRIPTDIR" for script's dir)
    -s SHELLNAME        --shell=SHELLNAME          Specify dialect (sh, bash, dash, ksh)
    -S SEVERITY         --severity=SEVERITY        Minimum severity of errors to consider (error, warning, info, style)
    -x                  --external-sources         Allow 'source' outside of FILES
    
  • thresholds:

    • num-issues:

      In addition to general severity levels, the following tool specific severity levels can be specified:

      • note (equivalent to general severity level info)
  • incremental:

    true/false

  • experimental:

    No tool specific experimental options are available.

YAML Examples

  • With default options:

    inspecode:
      tools:
        shellcheck: default
    
  • With custom machine:

    inspecode:
      tools:
        shellcheck:
          machine:
            cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
    
  • With custom options:

    inspecode:
      tools:
        shellcheck:
          options:
            --exclude: SC2030,SC2031,SC2064
            --shell: bash
    

results matching ""

    No results matching ""