(text: str, line: int, parent_nid: str)
| 5781 | return None |
| 5782 | |
| 5783 | def _add_rationale(text: str, line: int, parent_nid: str) -> None: |
| 5784 | label = text[:80].replace("\r\n", " ").replace("\r", " ").replace("\n", " ").strip() |
| 5785 | rid = _make_id(stem, "rationale", str(line)) |
| 5786 | if rid not in seen_ids: |
| 5787 | seen_ids.add(rid) |
| 5788 | nodes.append({ |
| 5789 | "id": rid, |
| 5790 | "label": label, |
| 5791 | "file_type": "rationale", |
| 5792 | "source_file": str_path, |
| 5793 | "source_location": f"L{line}", |
| 5794 | }) |
| 5795 | edges.append({ |
| 5796 | "source": rid, |
| 5797 | "target": parent_nid, |
| 5798 | "relation": "rationale_for", |
| 5799 | "confidence": "EXTRACTED", |
| 5800 | "source_file": str_path, |
| 5801 | "source_location": f"L{line}", |
| 5802 | "weight": 1.0, |
| 5803 | }) |
| 5804 | |
| 5805 | # Module-level docstring — skip for auto-generated files (Alembic, Django |
| 5806 | # migrations, protobuf stubs, etc.) whose module docstrings are revision |
no test coverage detected