I have installed SwiftLint using SwiftLint.pkg in my system. Now I want to customize the rules so I have added .swiftlint.yml file in my root directory. I have added the script. I have followed the steps that are mentioned in the documentation, But somehow it's not working.
Script:
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
Rule in .switlint.yml file :
custom_rules:
comma_space_rule:
regex: ",[ ]{2,}"
message: "Expected only one space after ',"
Your rule is fine! 🎉
I tried it and it is working. You just need to indent properly:
custom_rules:
comma_space_rule:
regex: ",[ ]{2,}"
message: "Expected only one space after ',"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With