diff --git a/pre_commit_hooks/check_jamf_extension_attributes.py b/pre_commit_hooks/check_jamf_extension_attributes.py index 21fa95d..df3c97e 100644 --- a/pre_commit_hooks/check_jamf_extension_attributes.py +++ b/pre_commit_hooks/check_jamf_extension_attributes.py @@ -3,7 +3,7 @@ """Check Jamf extension attributes for common issues.""" import argparse -import os +import re def build_argument_parser(): @@ -29,8 +29,12 @@ def main(argv=None): ea_content = openfile.read() if "" not in ea_content or "" not in ea_content: - print("{}: missing and/or tags".format(filename)) + print(f"{filename}: missing and/or tags") retval = 1 + all_results = len(re.findall("result.*\/result", ea_content)) + proper_results = len(re.findall(".*<\/result>", ea_content)) + if proper_results < all_results: + print(f"{filename}: has incomplete tags!") return retval