Skip to content

Commit

Permalink
Fix filtering of dir/files (fixup)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Mar 28, 2023
1 parent aa87ebb commit 0ff5d86
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pylint/testutils/functional/find_functional_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _get_files_from_dir(
) -> list[Path]:
"""Return directories and files from a directory and handles violations."""
files_without_leading_underscore = list(
p for p in path.iterdir() if not str(p).startswith("_")
p for p in path.iterdir() if not p.stem.startswith("_")
)
if len(files_without_leading_underscore) > max_file_per_directory:
violations.append((path, len(files_without_leading_underscore)))
Expand Down Expand Up @@ -103,8 +103,6 @@ def walk(path: Path) -> Iterator[Path]:

# Collect all sub-directories and files in directory
for file_or_dir in walk(directory):
if file_or_dir.stem.startswith("_"):
continue
if file_or_dir.is_dir():
dirs.add(file_or_dir)
elif file_or_dir.suffix == ".py":
Expand Down

0 comments on commit 0ff5d86

Please sign in to comment.