Extract lines that contain code includes. Return list of CodeIncludeInfo, where each dict contains: - `line_no` - line number (1-based) - `line` - text of the line
(lines: list[str])
| 79 | |
| 80 | |
| 81 | def extract_code_includes(lines: list[str]) -> list[CodeIncludeInfo]: |
| 82 | """ |
| 83 | Extract lines that contain code includes. |
| 84 | |
| 85 | Return list of CodeIncludeInfo, where each dict contains: |
| 86 | - `line_no` - line number (1-based) |
| 87 | - `line` - text of the line |
| 88 | """ |
| 89 | |
| 90 | includes: list[CodeIncludeInfo] = [] |
| 91 | for line_no, line in enumerate(lines, start=1): |
| 92 | if CODE_INCLUDE_RE.match(line): |
| 93 | includes.append(CodeIncludeInfo(line_no=line_no, line=line)) |
| 94 | return includes |
| 95 | |
| 96 | |
| 97 | def replace_code_includes_with_placeholders(text: list[str]) -> list[str]: |
no test coverage detected