Skip to content

Instantly share code, notes, and snippets.

@yene
Created May 10, 2011 15:53
Show Gist options
  • Save yene/964741 to your computer and use it in GitHub Desktop.
Save yene/964741 to your computer and use it in GitHub Desktop.
pre-commit hook which uses clang static analyter before commit
#!/bin/sh
RESULT=$(xcodebuild -configuration Debug RUN_CLANG_STATIC_ANALYZER=YES)
if `echo ${RESULT} | grep "generated." 1>/dev/null 2>&1`
then
echo "commit failed: anaylzer error found"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment