我已经在我的系统中使用SwiftLint安装了SwiftLint.pkg。现在,我希望自定义规则,以便在根目录中添加.swiftlint.yml文件。我增加了剧本。我遵循了文档中提到的步骤,但不知怎么的,它不起作用。
剧本:
if which swiftlint >/dev/null; then
swiftlint --config "$SRCROOT/.swiftlint.yml"
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi.switlint.yml文件中的规则:
custom_rules:
comma_space_rule:
regex: ",[ ]{2,}"
message: "Expected only one space after ',"发布于 2020-08-22 23:23:08
你的规则很好!
我试过了,效果很好。你只需要正确地缩进:
custom_rules:
comma_space_rule:
regex: ",[ ]{2,}"
message: "Expected only one space after ',"https://stackoverflow.com/questions/62319137
复制相似问题