Sider Documentation

Sider Documentation

  • Enterprise
  • News
  • Sider Top

›Shell script

Getting Started

  • Home
  • Intro Videos
  • Setting up Sider
  • Dashboard Overview
  • Repository Settings
  • Custom Analysis Configuration
  • Recommended Ruleset
  • Working with Issues
  • Permissions
  • Skip Analyzing

Analysis Tools

    Ruby

    • RuboCop
    • Reek
    • Querly
    • Rails Best Practices
    • Brakeman
    • HAML-Lint
    • Slim-Lint (beta)

    Java

    • Checkstyle
    • PMD
    • JavaSee

    Kotlin

    • ktlint (beta)
    • detekt (beta)

    JavaScript and Flavors

    • ESLint
    • JSHint
    • TyScan
    • CoffeeLint
    • TSLint (deprecated)

    CSS

    • stylelint
    • SCSS-Lint (deprecated)

    PHP

    • PHP_CodeSniffer
    • PHPMD
    • Phinder

    Python

    • Flake8
    • Pylint (beta)

    Swift

    • SwiftLint

    Go

    • GolangCI-Lint

    C/C++

    • Cppcheck
    • cpplint
    • Clang-Tidy (beta)

    C#

    • FxCop (beta)

    Shell script

    • ShellCheck

    Dockerfile

    • hadolint

    Markdown

    • remark-lint

    Others

    • Goodcheck
    • Misspell
    • LanguageTool (beta)
    • PMD CPD (beta)

Custom Rules

  • Intro to Custom Rules
  • Goodcheck
  • Tips & Tricks

Advanced Settings

  • Inline Comments
  • Private Dependencies
  • Restricting access to Close button
  • Transferring a repository

Billing and Plans

  • Billing and Plans

Troubleshooting

  • Troubleshooting

Enterprise

  • Outline
  • System Overview
  • Installation
  • Configuration
  • Operation
  • Update
  • Load Balancer
  • MySQL
  • Redis
  • MinIO
  • Amazon S3
  • GitHub Enterprise Server
  • Clustering
  • Example Deployments

    • Single Node with Docker Compose

    Releases

    • Overview
    • January 2021
    • December 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • February 2020
    • January 2020
    • November 2019
    • Older releases

News

  • 2021
  • 2020
  • 2019
Edit

ShellCheck

Supported VersionLanguageWebsite
0.7.1Shell scripthttps://www.shellcheck.net

ShellCheck is a static analysis tool to find bugs in shell script code. It gives warnings and suggestions.

Getting Started

To start using ShellCheck, enable it in your repository settings.

For more details, see the ShellCheck's CLI manual and Wiki.

Configuration

Here is a configuration example via sider.yml:

linter:
  shellcheck:
    target: "src/**/*.{sh,bash}"
    include: [SC2104, SC2105]
    exclude: [SC1000, SC1118]
    enable: all
    shell: bash
    severity: error
    norc: true

You can use the following options to fine-tune ShellCheck to your project.

NameTypeDefault
root_dirstring-
targetstring, string[], hash[](See below)
includestring, string[]-
excludestring, string[]-
enablestring, string[]-
shellstring-
severitystring-
norcbooleanfalse

target

This option allows you to specify files to analyze. Glob patterns are also available.

The default value is:

linter:
  shellcheck:
    target:
      - "**/*.{bash,bats,dash,ksh,sh}"
      - shebang: true

shebang: true is a special form. if enabling this form, Sider analyzes files including a shebang like #!/bin/sh even if they do not have a file extension like .sh.

For example, if you have a file named hello including the following content, Sider analyzes it.

#!/bin/sh

echo "This script's filename is `hello`."

If you want to disable this shebang behavior, explicitly specify shebang: false as follow:

linter:
  shellcheck:
    target:
      - "**/*.{bash,sh}"
      - shebang: false

include

This option allows you to include only rules you want, e.g. SC2104 or SC2105.

exclude

This option allows you to exclude rules you want, e.g. SC2104 or SC2105.

enable

This option allows you to enable the predefined optional checks. The special name all enables all of them.

For example:

linter:
  shellcheck:
    enable: all

You can see a list of all the optional checks via shellcheck --list-optional command. Here is an example to enable some optional checks:

linter:
  shellcheck:
    enable:
      - add-default-case
      - avoid-nullary-conditions

shell

This option allows you to specify a shell dialect. Valid values are sh, bash, dash, and ksh. If omitted, Sider deduces it automatically.

severity

This option allows you to specify a minimum severity of errors to consider. Valid values in order of severity are error, warning, info, and style. If omitted, Sider uses the ShellCheck's default one.

norc

This option allows you to select whether looking for ShellCheck's configuration files.

← FxCop (beta)hadolint →
  • Getting Started
  • Configuration
    • target
    • include
    • exclude
    • enable
    • shell
    • severity
    • norc
Sider Documentation
Docs
Getting StartedAnalysis ToolsEnterprise
Sider
Sider TopTerms of ServicePrivacy
Social
BlogGitHubStar
Copyright © 2021 Sider, Inc.