Skip to content

Commit

Permalink
fix: ensure iteration over directories (#452)
Browse files Browse the repository at this point in the history
* fix: ensure iteration over directories

* style: pre-commit fixes

* Update src/sp_repo_review/checks/general.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
henryiii and pre-commit-ci[bot] authored Jul 10, 2024
1 parent edeb71e commit 42353bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sp_repo_review/checks/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ def check(package: Traversable) -> bool:
src = package.joinpath("src")
if src.is_dir():
for pkg in src.iterdir():
if len([p for p in pkg.iterdir() if "test" in p.name]) > 0:
if (
pkg.is_dir()
and len([p for p in pkg.iterdir() if "test" in p.name]) > 0
):
return True
return False

Expand Down

0 comments on commit 42353bd

Please sign in to comment.