Created
November 21, 2013 22:39
-
-
Save SergioEstevao/7591105 to your computer and use it in GitHub Desktop.
An OCLint script to use on Xcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import path | |
export PATH=${PATH}:/usr/local/bin | |
#import what we have in bash_profile | |
source ~/.bash_profile | |
#check for oclint | |
hash oclint &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo >&2 "oclint not found, analyzing stopped" | |
exit 1 | |
fi | |
hash xctool &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo >&2 "xctool not found, analyzing stopped" | |
exit 1 | |
fi | |
cd ${SRCROOT} | |
xctool -workspace MyProject.xcworkspace -scheme MyProject clean | |
xctool -workspace MyProject.xcworkspace -scheme MyProject -reporter json-compilation-database:compile_commands.json build | |
oclint-json-compilation-database \ | |
-e Pods \ | |
-- -rc=LONG_LINE=200 \ | |
-rc=NCSS_METHOD=60 \ | |
-rc=LONG_METHOD=100 \ | |
-rc=MINIMUM_CASES_IN_SWITCH=1 \ | |
| sed 's/\(.*\.\m\{1,2\}:[0-9]*:[0-9]*:\)/\1 warning:/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice