Skip to content

Commit 5646d29

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7aca3c8 commit 5646d29

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

pylint/lint/parallel.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ def check_parallel(
135135
# The linter is inherited by all the pool's workers, i.e. the linter
136136
# is identical to the linter object here. This is required so that
137137
# a custom PyLinter object can be used.
138-
initializer = functools.partial(
139-
_worker_initialize, extra_sys_paths=extra_sys_paths
140-
)
138+
initializer = functools.partial(_worker_initialize, extra_sys_paths=extra_sys_paths)
141139
with ProcessPoolExecutor(
142140
max_workers=jobs, initializer=initializer, initargs=(dill.dumps(linter),)
143141
) as executor:

pylint/lint/pylinter.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
from pylint.lint.utils import (
5151
_is_relative_to,
5252
augmented_sys_path,
53-
realpath_transformer,
5453
get_fatal_error_message,
5554
prepare_crash_report,
55+
realpath_transformer,
5656
)
5757
from pylint.message import Message, MessageDefinition, MessageDefinitionStore
5858
from pylint.reporters.base_reporter import BaseReporter
@@ -75,8 +75,7 @@
7575
class GetAstProtocol(Protocol):
7676
def __call__(
7777
self, filepath: str, modname: str, data: str | None = None
78-
) -> nodes.Module:
79-
...
78+
) -> nodes.Module: ...
8079

8180

8281
def _read_stdin() -> str:
@@ -310,9 +309,9 @@ def __init__(
310309
"""Dictionary of possible but non-initialized reporters."""
311310

312311
# Attributes for checkers and plugins
313-
self._checkers: defaultdict[
314-
str, list[checkers.BaseChecker]
315-
] = collections.defaultdict(list)
312+
self._checkers: defaultdict[str, list[checkers.BaseChecker]] = (
313+
collections.defaultdict(list)
314+
)
316315
"""Dictionary of registered and initialized checkers."""
317316
self._dynamic_plugins: dict[str, ModuleType | ModuleNotFoundError | bool] = {}
318317
"""Set of loaded plugin names."""
@@ -674,7 +673,9 @@ def check(self, files_or_modules: Sequence[str]) -> None:
674673
}
675674
)
676675
# Prefer package paths detected per module over user-defined PYTHONPATH additions
677-
extra_sys_paths = extra_packages_paths + realpath_transformer(self.config.pythonpath)
676+
extra_sys_paths = extra_packages_paths + realpath_transformer(
677+
self.config.pythonpath
678+
)
678679

679680
# TODO: Move the parallel invocation into step 3 of the checking process
680681
if not self.config.from_stdin and self.config.jobs > 1:

pylint/pyreverse/main.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ def run(self, args: list[str]) -> int:
305305
{discover_package_path(arg, self.config.source_roots) for arg in args}
306306
)
307307
# Prefer package paths detected per module over global PYTHONPATH additons
308-
extra_sys_paths = extra_packages_paths + realpath_transformer(self.config.pythonpath)
308+
extra_sys_paths = extra_packages_paths + realpath_transformer(
309+
self.config.pythonpath
310+
)
309311
with augmented_sys_path(extra_sys_paths):
310312
project = project_from_files(
311313
args,

tests/lint/unittest_lint.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,9 @@ def test_import_sibling_module_from_namespace(initialized_linter: PyLinter) -> N
12501250
assert not linter.stats.by_msg
12511251

12521252

1253-
def test_import_external_module_with_relative_pythonpath_config(initialized_linter: PyLinter) -> None:
1253+
def test_import_external_module_with_relative_pythonpath_config(
1254+
initialized_linter: PyLinter,
1255+
) -> None:
12541256
"""Given a module that imports an external module, ensure that the external module
12551257
is found when the path to the external module is configured in `main.pythonpath`.
12561258

tests/test_check_parallel.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ def test_worker_initialize(self) -> None:
186186
def test_worker_initialize_with_package_paths(self) -> None:
187187
linter = PyLinter(reporter=Reporter())
188188
with augmented_sys_path([]):
189-
worker_initialize(
190-
linter=dill.dumps(linter), extra_sys_paths=["fake-path"]
191-
)
189+
worker_initialize(linter=dill.dumps(linter), extra_sys_paths=["fake-path"])
192190
assert "fake-path" in sys.path
193191

194192
def test_worker_initialize_reregisters_custom_plugins(self) -> None:

0 commit comments

Comments
 (0)