Skip to content

Commit

Permalink
Add negation to reports for prohibited facets
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjska committed Apr 24, 2023
1 parent 5e6a094 commit c4b0f66
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ifctester/ifctester/facet.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ def to_string(self, clause_type):
template = template.replace(key_variable, str(value))
total_replacements += 1
if total_replacements == total_variables:
if hasattr(self, "maxOccurs") and clause_type == "requirement":
if self.maxOccurs == 0:
template = re.sub(
r"(?i)(shall|must)", r"\1 not", template, 1
) # replace "shall/must" with "shall not/must not"
return template
return template

def to_ids_value(self, parameter):
Expand Down

0 comments on commit c4b0f66

Please sign in to comment.