我正在尝试使用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' .发布于 2021-04-30 06:07:09
下面是ShellCheck中使用的所有规则的list。
我建议您使用DeepSource对Shell脚本运行分析。DeepSource可以检测到超过210个问题,并为您提供自动修复这些问题的选项。
如果您使用DeepSource,那么您将不必到处查找规则信息,因为DeepSource为您提供了查看它检测到的每个问题的描述以及为什么要修复该问题的选项。
https://stackoverflow.com/questions/44242816
复制相似问题