10
10
11
11
from pylint .testutils .functional .test_file import FunctionalTestFile
12
12
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.
15
16
16
17
'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.
17
20
"""
18
21
19
22
IGNORED_PARENT_DIRS = {
20
23
"deprecated_relative_import" ,
21
24
"ext" ,
22
25
"regression" ,
23
26
"regression_02" ,
24
- "used_02" ,
25
27
}
26
28
"""Direct parent directories that should be ignored."""
27
29
@@ -71,7 +73,9 @@ def _get_files_from_dir(
71
73
) -> list [Path ]:
72
74
"""Return directories and files from a directory and handles violations."""
73
75
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" ))
75
79
)
76
80
if len (files_without_leading_underscore ) > max_file_per_directory :
77
81
violations .append ((path , len (files_without_leading_underscore )))
@@ -86,7 +90,6 @@ def walk(path: Path) -> Iterator[Path]:
86
90
)
87
91
for _file_or_dir in parent_dir_files :
88
92
if _file_or_dir .is_dir ():
89
- _files = _get_files_from_dir (_file_or_dir , violations )
90
93
yield _file_or_dir .resolve ()
91
94
try :
92
95
yield from walk (_file_or_dir )
0 commit comments