True when `path` is vendored / upstream and must never be stripped, regardless of whether it was reached by a directory walk or passed explicitly on the command line.
(path: Path)
| 91 | |
| 92 | |
| 93 | def _is_vendored(path: Path) -> bool: |
| 94 | """True when `path` is vendored / upstream and must never be stripped, |
| 95 | regardless of whether it was reached by a directory walk or passed |
| 96 | explicitly on the command line.""" |
| 97 | parts = set(path.parts) |
| 98 | if parts & _SKIP_DIRS: |
| 99 | return True |
| 100 | lowered = str(path).replace("\\", "/").lower() |
| 101 | if "/lemonsqueezy/" in lowered: |
| 102 | return True |
| 103 | return any(path.name.startswith(p) for p in _VENDORED_NAME_PREFIXES) |
| 104 | |
| 105 | |
| 106 | def _fence_mask(lines: list[str]) -> list[bool]: |