Extract the basename of every #include'd file.
(lines: list[str])
| 86 | |
| 87 | |
| 88 | def _extract_included_filenames(lines: list[str]) -> set[str]: |
| 89 | """Extract the basename of every #include'd file.""" |
| 90 | includes: set[str] = set() |
| 91 | for line in lines: |
| 92 | m = _INCLUDE_RE.match(line) |
| 93 | if m: |
| 94 | inc_path = m.group(1) |
| 95 | inc_name = inc_path.rsplit("/", 1)[-1] |
| 96 | includes.add(inc_name) |
| 97 | return includes |
| 98 | |
| 99 | |
| 100 | class IsHeaderIncludeChecker(FileContentChecker): |