Skip to content

Commit

Permalink
Improved language checker
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiasini committed Jul 8, 2019
1 parent f7bbab0 commit 205ec34
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/language/test_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"

0 comments on commit 205ec34

Please sign in to comment.