Parse the content of all doc files to detect which classes and functions it documents
()
| 523 | |
| 524 | |
| 525 | def find_all_documented_objects(): |
| 526 | """Parse the content of all doc files to detect which classes and functions it documents""" |
| 527 | documented_obj = [] |
| 528 | for doc_file in Path(PATH_TO_DOC).glob("**/*.rst"): |
| 529 | with open(doc_file, "r", encoding="utf-8", newline="\n") as f: |
| 530 | content = f.read() |
| 531 | raw_doc_objs = re.findall(r"(?:autoclass|autofunction):: transformers.(\S+)\s+", content) |
| 532 | documented_obj += [obj.split(".")[-1] for obj in raw_doc_objs] |
| 533 | for doc_file in Path(PATH_TO_DOC).glob("**/*.md"): |
| 534 | with open(doc_file, "r", encoding="utf-8", newline="\n") as f: |
| 535 | content = f.read() |
| 536 | raw_doc_objs = re.findall(r"\[\[autodoc\]\]\s+(\S+)\s+", content) |
| 537 | documented_obj += [obj.split(".")[-1] for obj in raw_doc_objs] |
| 538 | return documented_obj |
| 539 | |
| 540 | |
| 541 | # One good reason for not being documented is to be deprecated. Put in this list deprecated objects. |
no outgoing calls
no test coverage detected