stubsabot: Skip test files in diff analysis (#11606)

This commit is contained in:
Sebastian Rittau
2024-03-15 13:08:40 +01:00
committed by GitHub
parent 6943dcd03f
commit 0b1e5d3f34

View File

@@ -372,11 +372,10 @@ class DiffAnalysis:
@functools.cached_property
def public_files_added(self) -> Sequence[str]:
return [
file["filename"]
for file in self.py_files
if not re.match("_[^_]", Path(file["filename"]).name) and file["status"] == "added"
]
def is_public(path: Path) -> bool:
return not re.match(r"_[^_]", path.name) and not path.name.startswith("test_")
return [file["filename"] for file in self.py_files if is_public(Path(file["filename"])) and file["status"] == "added"]
@functools.cached_property
def typeshed_files_deleted(self) -> Sequence[str]: