Return the configured allowlist patterns. The default tuple above is always included. If ``path`` is given, any non-comment, non-blank line is appended to the result.
(path: pathlib.Path | None)
| 66 | |
| 67 | |
| 68 | def _load_allowlist(path: pathlib.Path | None) -> list[str]: |
| 69 | """Return the configured allowlist patterns. |
| 70 | |
| 71 | The default tuple above is always included. If ``path`` is given, |
| 72 | any non-comment, non-blank line is appended to the result. |
| 73 | """ |
| 74 | patterns = list(DEFAULT_ALLOWLIST) |
| 75 | if path is None: |
| 76 | return patterns |
| 77 | for raw in path.read_text(encoding="utf-8").splitlines(): |
| 78 | line = raw.strip() |
| 79 | if not line or line.startswith("#"): |
| 80 | continue |
| 81 | patterns.append(line) |
| 82 | return patterns |
| 83 | |
| 84 | |
| 85 | def _strip_catchall_ignores(conf_py: pathlib.Path, strip: list[str]) -> str: |