Skip to content

Commit

Permalink
consistency_checks.py: Fix skip errors handling of numeric arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed (ODSC) committed Jun 26, 2023
1 parent 8bc6072 commit 6237010
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions consistency_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,14 @@ def _error_stats(self):

def _skip_errors(self, stats):
"""Skip any known errors"""
if stats["missing"] > 0 and not stats["missing"] is self.check_missing_fields:
if stats["missing"] > 0 and (isinstance(self.check_missing_fields, bool) or
stats["missing"] != self.check_missing_fields):
return False
elif stats["duplicate"] > 0 and not stats["duplicate"] is self.check_statement_dups:
elif stats["duplicate"] > 0 and (isinstance(self.check_statement_dups, bool) or
stats["duplicate"] != self.check_statement_dups):
return False
elif stats["reference"] > 0 and not stats["reference"] is self.check_statement_refs:
elif stats["reference"] > 0 and (isinstance(self.check_statement_refs, bool) or
stats["reference"] != self.check_statement_refs):
return False
else:
return True
Expand Down

0 comments on commit 6237010

Please sign in to comment.