Skip to content

Commit 648b52c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 679f1f2 commit 648b52c

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

pylint/lint/expand_modules.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from collections.abc import Sequence
1010
from pathlib import Path
1111
from re import Pattern
12-
from typing import cast
1312

1413
from astroid import modutils
1514

@@ -37,7 +36,7 @@ def discover_package_path(
3736
for source_root in source_roots:
3837
source_root = os.path.realpath(os.path.expanduser(source_root))
3938
if os.path.commonpath([source_root, dirname]) == source_root:
40-
#return cast(Sequence[str], [source_root])
39+
# return cast(Sequence[str], [source_root])
4140
return [source_root]
4241

4342
if len(source_roots) != 0:

pylint/lint/pylinter.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,11 @@ def check(self, files_or_modules: Sequence[str]) -> None:
667667
extra_packages_paths = list(
668668
dict.fromkeys(
669669
[
670-
path for file_or_module in files_or_modules
671-
for path in discover_package_path(file_or_module, self.config.source_roots)
670+
path
671+
for file_or_module in files_or_modules
672+
for path in discover_package_path(
673+
file_or_module, self.config.source_roots
674+
)
672675
]
673676
).keys()
674677
)

pylint/pyreverse/main.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,11 @@ def run(self, args: list[str]) -> int:
302302
print(self.help())
303303
return 1
304304
extra_packages_paths = list(
305-
{path for arg in args
306-
for path in discover_package_path(arg, self.config.source_roots)}
305+
{
306+
path
307+
for arg in args
308+
for path in discover_package_path(arg, self.config.source_roots)
309+
}
307310
)
308311
with augmented_sys_path(extra_packages_paths):
309312
project = project_from_files(

tests/lint/unittest_lint.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ def test_one_arg(fake_path: list[str], case: list[str]) -> None:
133133
expected = [join(chroot, "a"), *fake_path]
134134

135135
extra_sys_paths = [
136-
path for arg in case
136+
path
137+
for arg in case
137138
for path in expand_modules.discover_package_path(arg, [])
138139
]
139140

@@ -158,7 +159,8 @@ def test_two_similar_args(fake_path: list[str], case: list[str]) -> None:
158159
expected = [join(chroot, "a"), *fake_path]
159160

160161
extra_sys_paths = [
161-
path for arg in case
162+
path
163+
for arg in case
162164
for path in expand_modules.discover_package_path(arg, [])
163165
]
164166

@@ -185,7 +187,8 @@ def test_more_args(fake_path: list[str], case: list[str]) -> None:
185187
] + fake_path
186188

187189
extra_sys_paths = [
188-
path for arg in case
190+
path
191+
for arg in case
189192
for path in expand_modules.discover_package_path(arg, [])
190193
]
191194

0 commit comments

Comments
 (0)