summaryrefslogtreecommitdiff
path: root/pylint/lint
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-04-01 21:26:46 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-04-03 22:49:21 +0200
commit55d3043f0066c526204635226284d317da003f85 (patch)
tree87f6b9de4b014b6dba875b1d0b5c808c0fc15e92 /pylint/lint
parent63ca05977dc11efe4c51f64a08c02fd0fb0566fc (diff)
downloadpylint-git-55d3043f0066c526204635226284d317da003f85.tar.gz
Format docstring of expand_modules
Diffstat (limited to 'pylint/lint')
-rw-r--r--pylint/lint/expand_modules.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/pylint/lint/expand_modules.py b/pylint/lint/expand_modules.py
index dc52811b5..dd59f7dcb 100644
--- a/pylint/lint/expand_modules.py
+++ b/pylint/lint/expand_modules.py
@@ -44,13 +44,11 @@ def _basename_in_ignore_list_re(base_name, ignore_list_re):
def expand_modules(files_or_modules, ignore_list, ignore_list_re):
- """take a list of files/modules/packages and return the list of tuple
- (file, module name) which have to be actually checked
- """
+ """Take a list of files/modules/packages and return the list of tuple
+ (file, module name) which have to be actually checked."""
result = []
errors = []
path = sys.path.copy()
-
for something in files_or_modules:
if os.path.basename(something) in ignore_list:
continue
@@ -85,10 +83,8 @@ def expand_modules(files_or_modules, ignore_list, ignore_list_re):
# removed once we move away from imp.find_module: https://bugs.python.org/issue10588
errors.append({"key": "fatal", "mod": modname, "ex": ex})
continue
-
filepath = os.path.normpath(filepath)
modparts = (modname or something).split(".")
-
try:
spec = modutils.file_info_from_modpath(
modparts, path=additional_search_path
@@ -100,7 +96,6 @@ def expand_modules(files_or_modules, ignore_list, ignore_list_re):
else:
is_namespace = modutils.is_namespace(spec)
is_directory = modutils.is_directory(spec)
-
if not is_namespace:
result.append(
{
@@ -111,7 +106,6 @@ def expand_modules(files_or_modules, ignore_list, ignore_list_re):
"basename": modname,
}
)
-
has_init = (
not (modname.endswith(".__init__") or modname == "__init__")
and os.path.basename(filepath) == "__init__.py"
@@ -126,7 +120,6 @@ def expand_modules(files_or_modules, ignore_list, ignore_list_re):
os.path.basename(subfilepath), ignore_list_re
):
continue
-
modpath = _modpath_from_file(
subfilepath, is_namespace, path=additional_search_path
)