MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / _is_vendored

Function _is_vendored

scripts/strip-inbody-comments.py:93–103  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

91
92
93def _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
106def _fence_mask(lines: list[str]) -> list[bool]:

Callers 1

_iter_filesFunction · 0.85

Calls 1

setFunction · 0.50

Tested by

no test coverage detected