Skip to content

[functional tests] Only count python files for the reasonably displayable limit #10490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pylint/testutils/functional/find_functional_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
from pylint.testutils.functional.test_file import FunctionalTestFile

REASONABLY_DISPLAYABLE_VERTICALLY = 49
"""'Wet finger' number of files that are reasonable to display by an IDE.
"""'Wet finger' number of python files that are reasonable to have in a functional test
directory.

'Wet finger' as in 'in my settings there are precisely this many'.
Initially the total number of file then we started counting only the python files to
avoid moving a lot of files.
"""

IGNORED_PARENT_DIRS = {
Expand Down Expand Up @@ -70,7 +73,9 @@ 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 p.stem.startswith("_")
p
for p in path.iterdir()
if not p.stem.startswith("_") and p.suffix == ".py"
)
if len(files_without_leading_underscore) > max_file_per_directory:
violations.append((path, len(files_without_leading_underscore)))
Expand Down
Loading