Skip to content

Instantly share code, notes, and snippets.

@andreweades
Last active March 15, 2022 07:36
Show Gist options
  • Save andreweades/ab430c4a66a8723601a850cbd9e55214 to your computer and use it in GitHub Desktop.
Save andreweades/ab430c4a66a8723601a850cbd9e55214 to your computer and use it in GitHub Desktop.
Xcode Benhavior script to run swiftlint
#!/bin/bash
# Written in respond to https://twitter.com/simonbs/status/1437678815866654723
DIR="$(echo "$XcodeProjectPath" | cut -f 1 -d '.')"
if which /opt/homebrew/bin/swiftlint >/dev/null; then
/opt/homebrew/bin/swiftlint $DIR/Sources > $DIR/lint-log.txt
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment