Skip to content

Instantly share code, notes, and snippets.

@cobbal
Last active October 2, 2019 20:07
Show Gist options
  • Save cobbal/5ea150749b8fcadece1ee7b698b8b7a2 to your computer and use it in GitHub Desktop.
Save cobbal/5ea150749b8fcadece1ee7b698b8b7a2 to your computer and use it in GitHub Desktop.
swift lint before commit, put in ".git/hooks/pre-commit", then chmod +x it
#!/bin/zsh
set -euo pipefail
if xcbeautify --version 2>/dev/null >/dev/null; then
./scripts/runSwiftLint.sh 2>&1 | xcbeautify
else
./scripts/runSwiftLint.sh 2>&1 | tail -n 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment