From 205ec342ada35d8882180be652d8e8ad679b9919 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Mon, 8 Jul 2019 01:00:14 -0700 Subject: [PATCH] Improved language checker --- tests/language/test_language.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/language/test_language.py b/tests/language/test_language.py index f80001970bff18..03b5cd2f4bf34c 100755 --- a/tests/language/test_language.py +++ b/tests/language/test_language.py @@ -3,14 +3,14 @@ import subprocess import sys -ignored_ext = [".pdf", ".jpg", ".png", "profanities.txt"] +checked_ext = ["h", "c", "py", "pyx", "cpp", "hpp", "md", "mk"] if __name__ == "__main__": with open("list.txt", 'r') as handle: suffix_cmd = " " - for i in ignored_ext: - suffix_cmd += "-- './*' ':(exclude)*" + i + "' " + for i in checked_ext: + suffix_cmd += "-- '*." + i + "' " found_profanity = False for line in handle: @@ -23,4 +23,6 @@ except subprocess.CalledProcessError as e: pass if found_profanity: - sys.exit("Found profanities") + sys.exit("Failed: Found profanities") + else: + print "Success"