maboloshi / Recordum

沙漠之子's 微博客
https://maboloshi.github.io/Recordum
2 stars 0 forks source link

shell脚本语法检查工具 #9

Open maboloshi opened 4 years ago

maboloshi commented 4 years ago

ShellCheck - 一个shell脚本静态分析工具

shellcheck是一款针对 bash/sh 语法检查工具,不仅能检查出语法错误,还能对出相应的解决方案。

安装

On macOS (OS X) with Homebrew:

brew install shellcheck

Or Windows (via scoop):

C:\> scoop install shellcheck

SublimeText 集成

简单的设置

    "linters": {
        "shellcheck": {
            "args": [
                "--external-sources",
                "--source-path=SCRIPTDIR",
                //"--exclude=SC2034,SC2154," // 忽略
            ],
            // "styles": [
            //  {
            //      "mark_style": "stippled_underline",
            //      "scope": "region.bluish",
            //      "types": ["warning"]
            //  }
            // ]
        }
    }