Skip to content

Commit 6c3e3c8

Browse files
committed
Added comments, types and make linters happy
1 parent 20ad408 commit 6c3e3c8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

pylint/lint/pylinter.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -1012,17 +1012,22 @@ def initialize(self):
10121012
if not msg.may_be_emitted():
10131013
self._msgs_state[msg.msgid] = False
10141014

1015-
def _discover_files(self, files_or_modules):
1015+
@staticmethod
1016+
def _discover_files(files_or_modules: Sequence[str]) -> Iterator[str]:
1017+
"""Discover python modules and packages in subdirectory.
1018+
1019+
Returns iterator of paths to discovered modules and packages.
1020+
"""
10161021
for something in files_or_modules:
10171022
if os.path.isdir(something) and not os.path.isfile(
10181023
os.path.join(something, "__init__.py")
10191024
):
10201025
skip_subtrees = []
1021-
for root, dirs, files in os.walk(something):
1026+
for root, _, files in os.walk(something):
10221027
if any(root.startswith(s) for s in skip_subtrees):
1023-
# Skip subtree of already discovered package
1028+
# Skip subtree of already discovered package.
10241029
continue
1025-
elif "__init__.py" in files:
1030+
if "__init__.py" in files:
10261031
skip_subtrees.append(root)
10271032
yield root
10281033
else:

0 commit comments

Comments
 (0)