【发布时间】:2017-10-29 18:46:09
【问题描述】:
我正在尝试使用 Shellcheck 对 shell 脚本进行静态代码分析。我想知道用于执行分析的规则。我在哪里可以买到它们?
下面是我得到的简单 helloworld 程序的示例输出:
In C:\Users\~\Desktop\hello.sh line 1:
#!/bin/sh
^-- SC1017: Literal carriage return. Run script through tr -d '\r' .
In C:\Users\~\Desktop\hello.sh line 2:
# This is a comment!
^-- SC1017: Literal carriage return. Run script through tr -d '\r' .
【问题讨论】:
-
ShellCheck wiki 看起来是个不错的起点。
标签: shell static-code-analysis shellcheck