1010
1111from pylint .testutils .functional .test_file import FunctionalTestFile
1212
13- REASONABLY_DISPLAYABLE_VERTICALLY = 49
14- """'Wet finger' number of files that are reasonable to display by an IDE.
13+ REASONABLY_DISPLAYABLE_VERTICALLY = 40
14+ """'Wet finger' number of python files that are reasonable to have in a functional test
15+ directory.
1516
1617'Wet finger' as in 'in my settings there are precisely this many'.
18+ Initially the total number of files then we started counting only the python files to
19+ avoid moving a lot of files.
1720"""
1821
1922IGNORED_PARENT_DIRS = {
2023 "deprecated_relative_import" ,
2124 "ext" ,
2225 "regression" ,
2326 "regression_02" ,
24- "used_02" ,
2527}
2628"""Direct parent directories that should be ignored."""
2729
@@ -71,7 +73,9 @@ def _get_files_from_dir(
7173 ) -> list [Path ]:
7274 """Return directories and files from a directory and handles violations."""
7375 files_without_leading_underscore = list (
74- p for p in path .iterdir () if not p .stem .startswith ("_" )
76+ p
77+ for p in path .iterdir ()
78+ if not (p .stem .startswith ("_" ) or (p .is_file () and p .suffix != ".py" ))
7579 )
7680 if len (files_without_leading_underscore ) > max_file_per_directory :
7781 violations .append ((path , len (files_without_leading_underscore )))
@@ -86,7 +90,6 @@ def walk(path: Path) -> Iterator[Path]:
8690 )
8791 for _file_or_dir in parent_dir_files :
8892 if _file_or_dir .is_dir ():
89- _files = _get_files_from_dir (_file_or_dir , violations )
9093 yield _file_or_dir .resolve ()
9194 try :
9295 yield from walk (_file_or_dir )
0 commit comments