From 60ff680e3c80e7aa80d09f9edf13c30f61d36aea Mon Sep 17 00:00:00 2001 From: Peter Mosmans Date: Sun, 20 Aug 2017 19:08:09 -0700 Subject: [PATCH] Add content of all includes for spell checking --- chatops/python/validate_report.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chatops/python/validate_report.py b/chatops/python/validate_report.py index 5de18e6..5e24150 100644 --- a/chatops/python/validate_report.py +++ b/chatops/python/validate_report.py @@ -245,6 +245,7 @@ def validate_xml(filename, options): with open(filename, 'rb') as xml_file: xml.sax.parse(xml_file, xml.sax.ContentHandler()) tree = ElementTree.parse(filename, ElementTree.XMLParser(strip_cdata=False)) + tree.xinclude() # Include everything type_result, xml_type = validate_type(tree, filename, options) result = validate_long_lines(tree, filename, options) and result and type_result if options['edit'] and not result: @@ -413,6 +414,7 @@ def validate_master(filename, findings, non_findings, scans, options): try: xmltree = ElementTree.parse(filename, ElementTree.XMLParser(strip_cdata=False)) + xmltree.xinclude() # include all stuff if not find_keyword(xmltree, 'TODO', filename): print('[-] Keyword checks failed for {0}'.format(filename)) result = False @@ -499,6 +501,7 @@ def close_file(filename): tree = ElementTree.parse(filename, ElementTree.XMLParser(strip_cdata=False)) tree.write(filename, encoding="utf-8", xml_declaration=True, pretty_print=True) + def find_keyword(xmltree, keyword, filename): """ Finds keywords in an XML tree.