Make sure we only return 1 when the docs don't match.

This commit is contained in:
Dirk Lemstra
2025-04-28 17:25:36 +02:00
parent f5c8c613c7
commit 7e3f3ae3db
+7 -4
View File
@@ -43,6 +43,7 @@ def check_signatures(doxygen_file, doc_signatures):
soup = BeautifulSoup(doxygen_content, 'html.parser')
correct = True
for table in soup.find_all('table', class_='memberdecls'):
rows = table.find_all('tr')
for row in rows:
@@ -59,15 +60,17 @@ def check_signatures(doxygen_file, doc_signatures):
# check if signature is in html file
if method_name in doc_signatures.keys():
DIFF_FOUND = True
if return_type not in doc_signatures[method_name]['returns']:
print(f"- Return type mismatch for method \"{method_name}\"")
print(f"Doxygen return type : {return_type}")
print(f"Documentation returns : {doc_signatures[method_name]['returns']} \n")
correct = False
if method_signature not in doc_signatures[method_name]['signatures']:
print(f"- Signature mismatch for method \"{method_name}\" ")
print(f"Doxygen signature : {method_signature}")
print(f"Documentation signatures : {doc_signatures[method_name]['signatures']} \n")
correct = False
return correct
"""
Used to normalize the text by removing extra spaces, new lines, tabs, etc.
@@ -94,9 +97,9 @@ def main(argv):
if not signatures:
print("No matching table found in the documentation")
sys.exit(1)
check_signatures(doxygen_file, signatures)
if DIFF_FOUND:
exit(-1)
if not check_signatures(doxygen_file, signatures):
sys.exit(1)
if __name__ == "__main__":
main(sys.argv[1:])