Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b1e5d3

Browse files
authored
stubsabot: Skip test files in diff analysis (#11606)
1 parent 6943dcd commit 0b1e5d3

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

scripts/stubsabot.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,10 @@ def runtime_definitely_has_consistent_directory_structure_with_typeshed(self) ->
372372

373373
@functools.cached_property
374374
def public_files_added(self) -> Sequence[str]:
375-
return [
376-
file["filename"]
377-
for file in self.py_files
378-
if not re.match("_[^_]", Path(file["filename"]).name) and file["status"] == "added"
379-
]
375+
def is_public(path: Path) -> bool:
376+
return not re.match(r"_[^_]", path.name) and not path.name.startswith("test_")
377+
378+
return [file["filename"] for file in self.py_files if is_public(Path(file["filename"])) and file["status"] == "added"]
380379

381380
@functools.cached_property
382381
def typeshed_files_deleted(self) -> Sequence[str]:

0 commit comments

Comments
 (0)