From d849f5d78c663b2d75c9c75594fd037cb9833c61 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Thu, 4 Aug 2016 10:41:57 -0700 Subject: [PATCH] editing --- public/posts/2016/08/ios-git-pre-commit-hook.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/posts/2016/08/ios-git-pre-commit-hook.md b/public/posts/2016/08/ios-git-pre-commit-hook.md index 8292d54..c7cd6cb 100644 --- a/public/posts/2016/08/ios-git-pre-commit-hook.md +++ b/public/posts/2016/08/ios-git-pre-commit-hook.md @@ -41,7 +41,9 @@ First ignore the fact I'm talking to a shell script. I don't get out much. Anywa if diff-index $test_glob | grep '^+' | egrep "$test_pattern" >/dev/null 2>&1 ... -and +_Pro tip: I wrapped test_pattern with `\b` to only match word boundaries to reduce false positives._ + +And: misplaced_pattern='misplaced="YES"' misplaced_glob=('*.xib' '*.storyboard') @@ -57,7 +59,7 @@ Then we need to show where the errors are by using `git grep`, with an `|| true` git grep -E "$test_pattern" $test_glob || true >&2 echo '----' >&2 -end for misplaced views: +And for misplaced views: echo "COMMIT REJECTED for misplaced views. Correct them before committing." >&2 git grep -E "$misplaced_pattern" $misplaced_glob || true >&2