From 14b2b30a9eb80d9dfb046f53d15890c97a962385 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 28 Jul 2020 23:18:20 -0400 Subject: [PATCH 1/7] Simple script to check for inclusive language. This CL adds a simple script to check for inclusive language. All files in the repo are scanned and any matches are output. --- tools/check_language.py | 99 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100755 tools/check_language.py diff --git a/tools/check_language.py b/tools/check_language.py new file mode 100755 index 000000000..8e91c67ef --- /dev/null +++ b/tools/check_language.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python + +# Copyright 2020 The Amber Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import print_function + +import fnmatch +import os +import re +import sys + +REGEXES = [ + r"(?i)(black|white|gr[ea]y)[-_]?list", + r"(?i)(first class citizen)", + r"(?i)(black|white|gr[ea]y)[-_]?hat", + r"(?i)(master|slave)", + r"(?i)\b(him|his|she|her|hers|man|woman)\b", + r"(?i)\s(he|he'd|he's|he'll)\s", + r"(?i)grandfather", + r"(?i)\bmitm\\b", + r"(?i)native", + r"(?i)\b(crazy|insane|blind\sto|flying\sblind|blind\seye|cripple|crippled|dumb|dummy|paranoid)\b", + r"(?i)\b(sane|sanity)\b", + r"(?i)red[-_]?line", +] + +def find(top, filename_glob, skip_glob_list): + """Returns files in the tree rooted at top matching filename_glob but not + in directories matching skip_glob_list.""" + + file_list = [] + for path, dirs, files in os.walk(top): + for glob in skip_glob_list: + for match in fnmatch.filter(dirs, glob): + dirs.remove(match) + for filename in fnmatch.filter(files, filename_glob): + if filename == os.path.basename(__file__): + continue + file_list.append(os.path.join(path, filename)) + return file_list + + +def filtered_descendants(glob): + """Returns glob-matching filenames under the current directory, but skips + some irrelevant paths.""" + return find('.', glob, ['third_party', 'external', 'build*', 'out*', + 'CompilerIdCXX', '.git']) + + +def alert_if_lang_matches(glob): + """Prints names of all files matching non-inclusive language. + + Finds all glob-matching files under the current directory and checks if they + contain the language pattern. Prints the names of all the files that + match. + + Returns the total number of file names printed. + """ + + reg_list = [] + for reg in REGEXES: + reg_list.append(re.compile(reg)) + + printed_count = 0 + for file in filtered_descendants(glob): + has_match = False + with open(file) as contents: + for line in contents: + for reg in reg_list: + match = reg.search(line) + if match: + print(file, ': found non-inclusive language:', match.group(0)) + printed_count += 1 + + return printed_count + + +def main(): + globs = ['*'] + count = 0 + for glob in globs: + count += alert_if_lang_matches(glob) + + sys.exit(count > 0) + +if __name__ == '__main__': + main() From 78aaf1a9916759d7a6868ed06061fc828bcfe5bc Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 28 Jul 2020 23:32:45 -0400 Subject: [PATCH 2/7] fix regex --- tools/check_language.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check_language.py b/tools/check_language.py index 8e91c67ef..991af73a0 100755 --- a/tools/check_language.py +++ b/tools/check_language.py @@ -29,7 +29,7 @@ r"(?i)\b(him|his|she|her|hers|man|woman)\b", r"(?i)\s(he|he'd|he's|he'll)\s", r"(?i)grandfather", - r"(?i)\bmitm\\b", + r"(?i)\bmitm\b", r"(?i)native", r"(?i)\b(crazy|insane|blind\sto|flying\sblind|blind\seye|cripple|crippled|dumb|dummy|paranoid)\b", r"(?i)\b(sane|sanity)\b", From 36306326637b785fa79e253ef2ca48de13679150 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 28 Jul 2020 23:36:26 -0400 Subject: [PATCH 3/7] formatting --- tools/check_language.py | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/check_language.py b/tools/check_language.py index 991af73a0..4ccb07f3b 100755 --- a/tools/check_language.py +++ b/tools/check_language.py @@ -22,18 +22,18 @@ import sys REGEXES = [ - r"(?i)(black|white|gr[ea]y)[-_]?list", - r"(?i)(first class citizen)", - r"(?i)(black|white|gr[ea]y)[-_]?hat", - r"(?i)(master|slave)", - r"(?i)\b(him|his|she|her|hers|man|woman)\b", - r"(?i)\s(he|he'd|he's|he'll)\s", - r"(?i)grandfather", - r"(?i)\bmitm\b", - r"(?i)native", - r"(?i)\b(crazy|insane|blind\sto|flying\sblind|blind\seye|cripple|crippled|dumb|dummy|paranoid)\b", - r"(?i)\b(sane|sanity)\b", - r"(?i)red[-_]?line", + r"(?i)(black|white|gr[ea]y)[-_]?list", + r"(?i)(first class citizen)", + r"(?i)(black|white|gr[ea]y)[-_]?hat", + r"(?i)(master|slave)", + r"(?i)\b(him|his|she|her|hers|man|woman)\b", + r"(?i)\s(he|he'd|he's|he'll)\s", + r"(?i)grandfather", + r"(?i)\bmitm\b", + r"(?i)native", + r"(?i)\b(crazy|insane|blind\sto|flying\sblind|blind\seye|cripple|crippled|dumb|dummy|paranoid)\b", + r"(?i)\b(sane|sanity)\b", + r"(?i)red[-_]?line", ] def find(top, filename_glob, skip_glob_list): @@ -46,9 +46,9 @@ def find(top, filename_glob, skip_glob_list): for match in fnmatch.filter(dirs, glob): dirs.remove(match) for filename in fnmatch.filter(files, filename_glob): - if filename == os.path.basename(__file__): - continue - file_list.append(os.path.join(path, filename)) + if filename == os.path.basename(__file__): + continue + file_list.append(os.path.join(path, filename)) return file_list @@ -71,18 +71,18 @@ def alert_if_lang_matches(glob): reg_list = [] for reg in REGEXES: - reg_list.append(re.compile(reg)) + reg_list.append(re.compile(reg)) printed_count = 0 for file in filtered_descendants(glob): has_match = False with open(file) as contents: for line in contents: - for reg in reg_list: - match = reg.search(line) - if match: - print(file, ': found non-inclusive language:', match.group(0)) - printed_count += 1 + for reg in reg_list: + match = reg.search(line) + if match: + print(file, ': found non-inclusive language:', match.group(0)) + printed_count += 1 return printed_count @@ -96,4 +96,4 @@ def main(): sys.exit(count > 0) if __name__ == '__main__': - main() + main() From 39c2f8c1f29bafd6f2cc80c835d60a1f9f0cf0c2 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 10 Aug 2020 17:14:49 -0400 Subject: [PATCH 4/7] Review feedback --- tools/check_language.py | 191 ++++++++++++++++++++++++----------- tools/check_language.pyc | Bin 0 -> 4656 bytes tools/check_language_test.py | 62 ++++++++++++ 3 files changed, 195 insertions(+), 58 deletions(-) create mode 100644 tools/check_language.pyc create mode 100755 tools/check_language_test.py diff --git a/tools/check_language.py b/tools/check_language.py index 4ccb07f3b..15cf0514e 100755 --- a/tools/check_language.py +++ b/tools/check_language.py @@ -6,7 +6,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import print_function +""" +Script to check files for inclusive language. The script will scan all files +and flag non-inclusive terminology which is identified. + +Usage, run the script from a folder and the script will scan down through that +folder. +""" import fnmatch import os @@ -22,78 +28,147 @@ import sys REGEXES = [ - r"(?i)(black|white|gr[ea]y)[-_]?list", - r"(?i)(first class citizen)", - r"(?i)(black|white|gr[ea]y)[-_]?hat", - r"(?i)(master|slave)", - r"(?i)\b(him|his|she|her|hers|man|woman)\b", - r"(?i)\s(he|he'd|he's|he'll)\s", - r"(?i)grandfather", - r"(?i)\bmitm\b", - r"(?i)native", - r"(?i)\b(crazy|insane|blind\sto|flying\sblind|blind\seye|cripple|crippled|dumb|dummy|paranoid)\b", - r"(?i)\b(sane|sanity)\b", - r"(?i)red[-_]?line", + r"(?i)black[-_]?list", + r"(?i)white[-_]?list", + r"(?i)gr[ea]y[-_]?list", + r"(?i)(first class citizen)", + r"(?i)black[-_]?hat", + r"(?i)white[-_]?hat", + r"(?i)gr[ea]y[-_]?hat", + r"(?i)master", + r"(?i)slave", + r"(?i)\bhim\b", + r"(?i)\bhis\b", + r"(?i)\bshe\b", + r"(?i)\bher\b", + r"(?i)\bhers\b", + r"(?i)\bman\b", + r"(?i)\bwoman\b", + r"(?i)\she\s", + r"(?i)\she$", + r"(?i)^he\s", + r"(?i)^he$", + "(?i)\\she['|\u2019]d\\s", + "(?i)\\she['|\u2019]d$", + "(?i)^he['|\u2019]d\\s", + "(?i)^he['|\u2019]d$", + "(?i)\\she['|\u2019]s\\s", + "(?i)\\she['|\u2019]s$", + "(?i)^he['|\u2019]s\\s", + "(?i)^he['|\u2019]s$", + "(?i)\\she['|\u2019]ll\\s", + "(?i)\\she['|\u2019]ll$", + "(?i)^he['|\u2019]ll\\s", + "(?i)^he['|\u2019]ll$", + r"(?i)grandfather", + r"(?i)\bmitm\b", + r"(?i)\bcrazy\b", + r"(?i)\binsane\b", + r"(?i)\bblind\sto\b", + r"(?i)\bflying\sblind\b", + r"(?i)\bblind\seye\b", + r"(?i)\bcripple\b", + r"(?i)\bcrippled\b", + r"(?i)\bdumb\b", + r"(?i)\bdummy\b", + r"(?i)\bparanoid\b", + r"(?i)\bsane\b", + r"(?i)\bsanity\b", + r"(?i)red[-_]?line", +] + +SUPPRESSIONS = [ + r"(?i)MS_SLAVE", + r"(?i)man[ -_]?page", ] + +REGEX_LIST = [] +for reg in REGEXES: + REGEX_LIST.append(re.compile(reg)) + +SUPPRESSION_LIST = [] +for supp in SUPPRESSIONS: + SUPPRESSION_LIST.append(re.compile(supp)) + def find(top, filename_glob, skip_glob_list): - """Returns files in the tree rooted at top matching filename_glob but not - in directories matching skip_glob_list.""" + """Returns files in the tree rooted at top matching filename_glob but not + in directories matching skip_glob_list.""" - file_list = [] - for path, dirs, files in os.walk(top): - for glob in skip_glob_list: - for match in fnmatch.filter(dirs, glob): - dirs.remove(match) - for filename in fnmatch.filter(files, filename_glob): - if filename == os.path.basename(__file__): - continue - file_list.append(os.path.join(path, filename)) - return file_list + file_list = [] + for path, dirs, files in os.walk(top): + for glob in skip_glob_list: + for match in fnmatch.filter(dirs, glob): + dirs.remove(match) + for filename in fnmatch.filter(files, filename_glob): + if filename == os.path.basename(__file__): + continue + file_list.append(os.path.join(path, filename)) + return file_list def filtered_descendants(glob): - """Returns glob-matching filenames under the current directory, but skips - some irrelevant paths.""" - return find('.', glob, ['third_party', 'external', 'build*', 'out*', - 'CompilerIdCXX', '.git']) + """Returns glob-matching filenames under the current directory, but skips + some irrelevant paths.""" + return find('.', glob, ['third_party', 'external', 'build*', 'out*', + 'CompilerIdCXX', '.git']) + +def check_match(filename, contents): + """Check if contents contains any matching entries""" + ret = False + for reg in REGEX_LIST: + match = reg.search(contents) + if match: + suppressed = False + for supp in SUPPRESSION_LIST: + idx = match.start() + supp_match = supp.match(contents[idx:]) + if supp_match: + suppressed = True + + # This is a hack to handle the MS_ prefix that is needed + # to check for. Find a better way if we get more suppressions + # which modify the prefix of the string + if idx >= 3: + supp_match = supp.match(contents[idx - 3:]) + if supp_match: + suppressed = True + + if not suppressed: + # No matching suppression. + print("{}: found non-inclusive language: {}".format( + filename, match.group(0))) + ret = True + + return ret def alert_if_lang_matches(glob): - """Prints names of all files matching non-inclusive language. - - Finds all glob-matching files under the current directory and checks if they - contain the language pattern. Prints the names of all the files that - match. - - Returns the total number of file names printed. - """ + """Prints names of all files matching non-inclusive language. - reg_list = [] - for reg in REGEXES: - reg_list.append(re.compile(reg)) + Finds all glob-matching files under the current directory and checks if they + contain the language pattern. Prints the names of all the files that + match. - printed_count = 0 - for file in filtered_descendants(glob): - has_match = False - with open(file) as contents: - for line in contents: - for reg in reg_list: - match = reg.search(line) - if match: - print(file, ': found non-inclusive language:', match.group(0)) - printed_count += 1 + Returns the total number of file names printed. + """ + printed_count = 0 + for file in filtered_descendants(glob): + has_match = False + with open(file) as contents: + if check_match(file, contents.read()): + printed_count += 1 - return printed_count + return printed_count def main(): - globs = ['*'] - count = 0 - for glob in globs: - count += alert_if_lang_matches(glob) + globs = ['*'] + count = 0 + for glob in globs: + count += alert_if_lang_matches(glob) - sys.exit(count > 0) + sys.exit(count > 0) if __name__ == '__main__': - main() + main() diff --git a/tools/check_language.pyc b/tools/check_language.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8d9e29f8a26e7d676a7bf2128a7384a04974f28 GIT binary patch literal 4656 zcmcInO>-N^5$y#?kPDHfWa>MLw6m({9ZjiW1;wL0-k+@A_mBbo}J0$K>bB(s4$@?UJ zN=>L;q9%-*qoWm)v$U~$g|_EO&e5JrvPgSnlJj)z@XzV~leSp+loc*z!V4r%oe*9a z3okia;sg2y@-Xn8t-#Em*$RyP&{kmbN49c?BnNvS=W#y(oyAy`U*qy(cZ{>1@WKiXzm5*b7jx z)5<|Cyhao>y*P<)Pv#q$wpE-&Nwe=Awp7^il=hU6u~7{r#cH|yRAc#DUfPR2Gufh% zCT%Z(GLev}$BUmBoa`@>L!OoP9^Z!u{vB{oPL@ zrOmh-Dj7NHK0A_brq5-t+n)?v8Vyt$D%Hjdqd;pfR7QOz;~Vo}&Td@cXQtgzQ%Avp)Tc(Roq9{Pcj{AZJ=NANIn{2-6zzq{e5^es&<7smpJ zN!F9=v%@Ruu|C{f8MnT)WAmfQXszgT`AQIcetodhd;iYek9P%@$Pbs7I5Dy^9>Dw) z{g{!T)%3ut_Rz1~L%(7Vp7GK>FyZ`5?T8{wdAW&EG*N6yVLK-`{)Lehy)@dVnF8dE z04PsSTvuBezVFHPglX_qA3bm6>eW@OgP1QpN8wJr9;p~7ZW8p4m900TzKWYWIvcHz zePApv`@Br9&`zD5y%TZY>G5u(K7q~&s6?+_N5@10Fd7IY|c za$+jQ$O&UP-tgBozxMerf4e!h7>IrDv2S-kC1DZDGI~pR*74}Spa9hli*)oI8KOOh z2E^35vHM5bDbjF;hO;y*(a}dVD4_Qa4Z-2p$rNa>NP}4#%+WCqEYonF+j}!KuuSfB zH)*STi?)uQXTH%w#IS?h<%;0qxMEkIVs1e&ahL0J_fV6Bi zmF?s}TG0;BY?vJCftIX-ZTLQ`?)z3c=yYT(tn^-@;%qm*K$u_{Pb@pu-Y`<86*Nqg zc0pFRI?Gd8P1vRlw|Femob9(=ncl2ezIp|9vW4dGxb{@T3)h6^I2NdMZ9^W&DCx8j zw$_4nU8ZX$Ng};w0o!zYe0RAy+Uvy}HaTR5y)=c|fvKZh~ z)MZyEZRsgUMDiej6knNMHLTmJ;izL;DiuDw*Yxe}$s=5J97LM0z1~xixT*QPlb*S0 zFKj(&cW~tCL$UtsnH^efDr50mwOq?zku%a9*Z~c}f)l<=__fbmXe={aH%yO-ZBk;)xmGj%IYfrS3icZGmp| z_l$`>Y=d>MD{|hVO$`h5;8(mufx6#QcaeWvV6a++uS9dUy>2r*)$qb3HoyV07E}TR z4J1|liQ8j{c|fu6=@k@T5AP%U0*+ot=yI^%_r4w~$WevQ)cVzDfQ2+n7}d=Oo6r2u zAJ(2&FV`|i!<(H9KEJanz|wF9+4 zEch9>4%q$f1|t?GqB({q!b$p=u?Y-)h-CoAE#T*iXWeC>#mUjK0LOfsDuxIXuJ)3~ zB)y*iWjejj(SSVO{S34RRN;%@hphBp8Of&i_Q>#Q&|uc;m)#LeEr;d1Fg-E-ta{!^ zQ)aj+ZMnlzJ|^O8z_oY4+U1PN0wys*U$k z_L>6)+t~*B{RwaT#YK*5-SKQ;l$-FV?^ifd*(}HRMH2dcm4inWPnHX%vU(?%uw1uU zGn@{eV7FTJGCHd7aKXN8R|~V?SiQo%?{dK#WyoR}*wd+gfZ9kMoBH?@gxK2unxn8f zKW`_Z7s+2-KwW=>qEuJ_DdE3ZbpC(;?o82fkr6FAmn|J$F1V-Nl6%!%cIOwI{{XER BXq5l} literal 0 HcmV?d00001 diff --git a/tools/check_language_test.py b/tools/check_language_test.py new file mode 100755 index 000000000..3534dab1b --- /dev/null +++ b/tools/check_language_test.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python + +# Copyright 2020 The Amber Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for check_language.py.""" + +import os +import sys +import unittest + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import check_language + +class TestCheckLanguage(unittest.TestCase): + def testMatches(self): + tests = ["blacklist", "black-list", "black_list", "whitelist", + "white-list", "white_list", "greylist", "grey-list", "grey_list", + "graylist", "gray-list", "gray_list", "first class citizen", + "blackhat", "black-hat", "black_hat", "whitehat", "white-hat", + "white_hat", "greyhat", "grey-hat", "grey_hat", "grayhat", + "gray-hat", "gray_hat", "master", "slave", "him", "his", "she", + "her", "hers", "man", "woman", "he", "he'd", "he's", "he'll", + #"he\u2019d", "he\u2019s", "he\u2019ll", + "grandfather", "mitm", "crazy", "insane", "blind to", + "flying blind", "blind eye", "cripple", "crippled", "dumb", + "dummy", "paranoid", "sane", "sanity", "redline", "red-line", + "red_line"] + + for word in tests: + self.assertTrue( + check_language.check_match("", "this is a " + word + " attempt"), + word) + + + def testSuppression(self): + self.assertFalse(check_language.check_match("", "in the man-pages")) + self.assertFalse(check_language.check_match("", "the MS_SLAVE test")) + + + def testMatchStartofFileWhenRequireSpace(self): + self.assertTrue(check_language.check_match("", "he said")) + + + def testMatchOverNewline(self): + self.assertTrue(check_language.check_match("", "flying\nblind")) + + +if __name__ == '__main__': + unittest.main() From 77d5795c5afe7f42d83f9531812f3049a6c97ec2 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 10 Aug 2020 17:29:55 -0400 Subject: [PATCH 5/7] more review --- tools/check_language.py | 35 ++++++++++++++++++++--------------- tools/check_language.pyc | Bin 4656 -> 4779 bytes 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/tools/check_language.py b/tools/check_language.py index 15cf0514e..b7ca528b2 100755 --- a/tools/check_language.py +++ b/tools/check_language.py @@ -48,18 +48,18 @@ r"(?i)\she$", r"(?i)^he\s", r"(?i)^he$", - "(?i)\\she['|\u2019]d\\s", - "(?i)\\she['|\u2019]d$", - "(?i)^he['|\u2019]d\\s", - "(?i)^he['|\u2019]d$", - "(?i)\\she['|\u2019]s\\s", - "(?i)\\she['|\u2019]s$", - "(?i)^he['|\u2019]s\\s", - "(?i)^he['|\u2019]s$", - "(?i)\\she['|\u2019]ll\\s", - "(?i)\\she['|\u2019]ll$", - "(?i)^he['|\u2019]ll\\s", - "(?i)^he['|\u2019]ll$", + r"(?i)\she['|\u2019]d\s", + r"(?i)\she['|\u2019]d$", + r"(?i)^he['|\u2019]d\s", + r"(?i)^he['|\u2019]d$", + r"(?i)\she['|\u2019]s\s", + r"(?i)\she['|\u2019]s$", + r"(?i)^he['|\u2019]s\s", + r"(?i)^he['|\u2019]s$", + r"(?i)\she['|\u2019]ll\s", + r"(?i)\she['|\u2019]ll$", + r"(?i)^he['|\u2019]ll\s", + r"(?i)^he['|\u2019]ll$", r"(?i)grandfather", r"(?i)\bmitm\b", r"(?i)\bcrazy\b", @@ -152,12 +152,17 @@ def alert_if_lang_matches(glob): Returns the total number of file names printed. """ + verbose = False printed_count = 0 for file in filtered_descendants(glob): has_match = False - with open(file) as contents: - if check_match(file, contents.read()): - printed_count += 1 + try: + with open(file, 'r', encoding='utf8') as contents: + if check_match(file, contents.read()): + printed_count += 1 + except: + if verbose: + print("skipping {}".format(file)) return printed_count diff --git a/tools/check_language.pyc b/tools/check_language.pyc index b8d9e29f8a26e7d676a7bf2128a7384a04974f28..b1f3815fae34cc3f814897bddeef2c52087d363b 100644 GIT binary patch delta 386 zcmXv}Jxc>Y6r6V-n?yZwBEcLMTByV}D5lncR)QyzG#17^W3K zDKI89&j!fMnQY;%31uKPAq_}o3uA*Gw~*OTrtYUUy4>WXfw+T|Z8mm!WCXONz;U}Z z@IbUlDIuOf7SOeIkY74D98AD!o6+LrNv-(x>UcEbU4U5Wb%W@lC&TDUSzHX&Wh2zu zQ8Le*T!;NWYisveO@Gh#G*y{q?p{BL{MvsN2j|jXVARgCWt$|Bv20D`*9el zK;~9?vZBYJBuLN_!=x%zXqitzUj9-ZQa!J@5A>ElyL+^q|G1~3&H=xXHx{RMwNzZ7 EU(Rbu^8f$< delta 264 zcmZ3jxWWIY8V+(m>A4~#^fsfnwSDnB>)tfoXI~;kPpaU;ACSIW@KaJXB1@=pDZO%%BVMaf Date: Tue, 11 Aug 2020 10:20:25 -0400 Subject: [PATCH 6/7] Remove pyc file --- .gitignore | 2 ++ tools/check_language.pyc | Bin 4779 -> 0 bytes 2 files changed, 2 insertions(+) delete mode 100644 tools/check_language.pyc diff --git a/.gitignore b/.gitignore index 55f5ccee7..d5f3eb0f8 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ third_party/vulkan-loader third_party/vulkan-validationlayers/ .vs +*.pyc + # Vim swap files [._]*.s[a-w][a-z] diff --git a/tools/check_language.pyc b/tools/check_language.pyc deleted file mode 100644 index b1f3815fae34cc3f814897bddeef2c52087d363b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4779 zcmcIn&vVn1)vXJ(F;8-iwq25C+OCqErvrz7PVb+z&ca8ma3vRBAbI4F z@WNR5sIx9UqOTzj2XEN|-290xz}efj0GIFB!f}#t{A1cFQIH!|y}B#qP7z|D zie{E}yb#93LS`NheyDRYzeu06T9)=(ZG1yh%{7**>fiW#sNaU8wNKRLMjS>v&#nbq zpTtU=aWhOZa?*TqB;CrM$#82h={Ps)s5MoljTgnC)?TEH`bs93_3`gb0!zlNlR3Ec z#4D!Y_Ufp;6KbrPc1Kkmhr3cA8Pzr$ZPnRqOx5*NUAN^_y)84;7bf}`drF`aCa5ot z1)isQOJUC@kEqA?aCK>1`_lH!kCahc(x-}%Ao%Rk{$~H?^&1~=2@FvzE)Q|2XKCC4 z{X^~0DAsDa<8^cB*Uq6|GY4zDat)6;vGajgOuXBpZ|Jo>@g7g%;VVZf=Z$?jAisz@Z7_r|AH5&c37spKanBY zc4(iNT35IJK$~S6&d_j{h85boL;EGPUZ){A{1TZGZI@|(miFi9fICjmaGvYiGqi7+ z-07{+dhaT&?>#Q0E3^-WXX#IA=+eGxr-V+042E$mEB~H)n!w2W$O`j?0E98F%gQ!G zXbgRt)*(}`AzzYC@$#kVX9;N9lC{c7(_~V5S(+LtypS2a>vcjCwXxq;FbO*{XvJy6 zYxE5m+EiU=3YE#oq?rQikHz(l>RQo&iE_EdD~WX=O0}86=Xn_Kzz?EkVs#8JGmHUg z*8`Y*U7*=8IW$5o*#uh&0yaGetaRAz%0yV{?NlZCY`lSR!7!d!c5J<2q)Z!V zm?-UlY_31cs%$2F(}ru@ms`&M+os%ZHmn%EhBDcg=JdGoL?a4UgyuXJs%&Ld?#ejr zc96DK!cIeGD<(~2y<+obFwT+Pft|aF==&1GSYo4@igVFfbj~@a@SJrj&XN=HZt}y% zTZq1g0+5LV5Ri#9{n9C?RiOh$0o$y3=mG`o)3x#574B%SpK#jblo|E23}%lvdvMia zfLBphU7dEMryvo_-4If|WqR4LZOewUj%lk*1c+WUu)8Psu+d2vYu@%oU&Z2z=Jihd z=8E00dugYOCC?s+drzO*uH}|87QepbS{~cC#DKz^S#%~>_zugY2!zxTFa>Wk0*tH) zR6gZI3}RmJF)#cb6)gI&M099=~4GEK}=rU)npw{WE6tcuv5rR>&}G#bwy()f0y(fgKqxA?aX zy3yY;CblsR#=)#O^Oo(=utfJi=NU@W`;K~x{96Zu)oZ*ZnoryJ?8#0wy(mo#aDY<_ z3L%mP4poCm*rSViKymEpCA?k?@8a|Y9KCd)E5Lr&dofgyqZ+TNjjPW93u%}z{I&aQ zPlGQW)F0a@*D}naw&6{$KY8@XU#r(2{PJPm&oQbE@a1#r1PLqbRU#$8O<> z*R@mme5A8jEL_5t5M|PgzO8&DwnO*3-ArmNbBf`r6;fi)+Q|)p4WBp1030Tr#^jUfTgbzG-@^>n>=jvU7U zj*?|VZ|h^y|g*G5=_7~eI+OmgtNc<8K@FS z#4Y0cO!i+{%w7rXGUGbYWTqQb-4V1c?-jE!r7>kKd)~-WX2mIMxxuChDB=d;+I?f| z3YKL7lbSI05}b5EtZitz|M4{zcSsQH~^=gm-1uND*|LDo17n5u(;uEw<4n z$abi6nEUVY7%y0lDa1PLdUT>q5k49MPoT>r&9dI%3)dCz-r?*|oaillUQGt^4QE;J?o=4pTc?l;>st z0=Is^FP_Na&BDyCj(>;6StkhWsVkUZ#g_ip;}H-2(@rY-vHaN?l=atmRZ0usL;RP^ iK*#^<-<>HtE)HXh&Uwqk=S%J}x8lCzo^|IJoc{piB!Za$ From d1439a029bbfb4ca50cde428046df496aa9a43d9 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 11 Aug 2020 15:52:10 -0400 Subject: [PATCH 7/7] enable tests --- tools/check_language_test.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/check_language_test.py b/tools/check_language_test.py index 3534dab1b..8f20791ad 100755 --- a/tools/check_language_test.py +++ b/tools/check_language_test.py @@ -33,7 +33,7 @@ def testMatches(self): "white_hat", "greyhat", "grey-hat", "grey_hat", "grayhat", "gray-hat", "gray_hat", "master", "slave", "him", "his", "she", "her", "hers", "man", "woman", "he", "he'd", "he's", "he'll", - #"he\u2019d", "he\u2019s", "he\u2019ll", + "he\u2019d", "he\u2019s", "he\u2019ll", "grandfather", "mitm", "crazy", "insane", "blind to", "flying blind", "blind eye", "cripple", "crippled", "dumb", "dummy", "paranoid", "sane", "sanity", "redline", "red-line", @@ -41,8 +41,7 @@ def testMatches(self): for word in tests: self.assertTrue( - check_language.check_match("", "this is a " + word + " attempt"), - word) + check_language.check_match("", "this is a " + word + " attempt"), word) def testSuppression(self):