From 905907154cf5a82b35012c847f7f0cc1d6d4f2fe Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Date: Tue, 11 Nov 2014 11:16:05 +0100
Subject: [PATCH] exclude 3rdparty and .ts files from apple terminology check

Change-Id: I302a20bf5359a676f2f506010fba7ce30c2d6231
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
---
 git-hooks/sanitize-commit | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit
index 63e597b..5ca6161 100755
--- a/git-hooks/sanitize-commit
+++ b/git-hooks/sanitize-commit
@@ -470,6 +470,7 @@ my $ws_check;
 my $tsv_check;
 my $eof_check;
 my $ctlkw_check;
+my $apple_check;
 open DIFF, "git diff-tree --patience --no-commit-id --diff-filter=ACMR --src-prefix=\@old\@/ --dst-prefix=\@new\@/ --full-index -r -U100000 --cc -C -l1000 --root ".$sha1." |" or die "cannot run git: $!";
 while (<DIFF>) {
     if (/^-/) {
@@ -550,7 +551,7 @@ while (<DIFF>) {
             }
         }
         check_spelling() if ($spell_check);
-        check_apple_terminology();
+        check_apple_terminology() if ($apple_check);
     } else {
         flushChunk() if ($chunk);
         if (/^ /) {
@@ -601,6 +602,7 @@ while (<DIFF>) {
             $eof_check = ($file !~ /\.plist(\.[^.\/]+)?$/); # Xcode consistently forgets the trailing newline
             # .ts files usually contain languages other than English
             $spell_check = !defined($cfg{spell}) && !$foreign && ($file !~ /\.ts$/i);
+            $apple_check = !$foreign && ($file !~ /\.ts$/i);
             $conflict_fail = defined($cfg{conflict});
             $braces = 0;
             $check_gen = 0;
-- 
GitLab