Skip to content

Commit

Permalink
Add a fail_fast option to checker for those who only case about pass/…
Browse files Browse the repository at this point in the history
…fail
  • Loading branch information
simoncozens committed Sep 12, 2023
1 parent 406476d commit 00b143d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shaperglot/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def codepoint_for(self, glyphname):
self._build_full_reversed_cmap()
return self.full_reversed_cmap.get(glyphname, 0)

def check(self, lang):
def check(self, lang, fail_fast=False):
self.results = Reporter()
self.lang = lang
for check_object in self.lang.get("shaperglot_checks", []):
Expand All @@ -60,4 +60,6 @@ def check(self, lang):
self.results.skip(check_name=check_object.name, message=skip_reason)
continue
check_object.execute(self)
if fail_fast and self.results.fails:
return self.results
return self.results

0 comments on commit 00b143d

Please sign in to comment.