Skip to content

Commit 4113349

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 366c09f commit 4113349

File tree

10 files changed

+11
-18
lines changed

10 files changed

+11
-18
lines changed

src/tox/config/loader/ini/replace.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,7 @@ def replace_reference( # noqa: PLR0912, C901
259259
exception = exc
260260
else:
261261
as_str, _ = stringify(value)
262-
as_str = as_str.replace("#", r"\#") # escape comment characters as these will be stripped
263-
return as_str
262+
return as_str.replace("#", r"\#") # escape comment characters as these will be stripped
264263
except Exception as exc: # noqa: BLE001
265264
exception = exc
266265
if exception is not None:

src/tox/config/loader/section.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __repr__(self) -> str:
5252

5353
def __eq__(self, other: Any) -> bool:
5454
return isinstance(other, self.__class__) and (self._prefix, self._name) == (
55-
other._prefix, # noqa: SLF001
55+
other._prefix,
5656
other.name,
5757
)
5858

src/tox/config/of_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__( # noqa: PLR0913
7171
of_type: type[T],
7272
default: Callable[[Config, str | None], T] | T,
7373
post_process: Callable[[T], T] | None = None,
74-
factory: Factory[T] = None,
74+
factory: Factory[T] | None = None,
7575
) -> None:
7676
super().__init__(keys, desc)
7777
self.of_type = of_type

src/tox/config/sets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def add_config( # noqa: PLR0913
4747
default: Callable[[Config, str | None], V] | V,
4848
desc: str,
4949
post_process: Callable[[V], V] | None = None,
50-
factory: Factory[Any] = None,
50+
factory: Factory[Any] | None = None,
5151
) -> ConfigDynamicDefinition[V]:
5252
"""
5353
Add configuration value.

src/tox/plugin/inline.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def _load_plugin(path: Path) -> ModuleType:
2727
try:
2828
if module_name in sys.modules:
2929
del sys.modules[module_name] # pragma: no cover
30-
module = importlib.import_module(module_name)
31-
return module
30+
return importlib.import_module(module_name)
3231
finally:
3332
del sys.path[0]

src/tox/run.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ def main(args: Sequence[str]) -> int:
4242
if result is not False:
4343
return result
4444
handler = state._options.cmd_handlers[state.conf.options.command] # noqa: SLF001
45-
result = handler(state)
46-
return result
45+
return handler(state)
4746

4847

4948
def setup_state(args: Sequence[str]) -> State:

src/tox/session/env_select.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __repr__(self) -> str:
4747
return f"{self.__class__.__name__}({'' if self.is_default_list else repr(str(self))})"
4848

4949
def __eq__(self, other: Any) -> bool:
50-
return type(self) == type(other) and self._names == other._names # noqa: SLF001
50+
return type(self) == type(other) and self._names == other._names
5151

5252
def __ne__(self, other: Any) -> bool:
5353
return not (self == other)

src/tox/tox_env/python/pip/req/file.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ def _get_file_content(self, url: str) -> str:
246246
scheme = get_url_scheme(url)
247247
if scheme in ["http", "https"]:
248248
with urlopen(url) as response: # noqa: S310
249-
text = self._read_decode(response)
250-
return text
249+
return self._read_decode(response)
251250
elif scheme == "file":
252251
url = url_to_path(url)
253252
try:
@@ -275,8 +274,7 @@ def _pre_process(self, content: str) -> ReqFileLines:
275274
lines_enum: ReqFileLines = enumerate(content.splitlines(), start=1)
276275
lines_enum = self._join_lines(lines_enum)
277276
lines_enum = self._ignore_comments(lines_enum)
278-
lines_enum = self._expand_env_variables(lines_enum)
279-
return lines_enum
277+
return self._expand_env_variables(lines_enum)
280278

281279
def _parse_line(self, line: str) -> tuple[str, Namespace]:
282280
args_str, options_str = self._break_args_options(line)

src/tox/tox_env/python/pip/req/util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ def url_to_path(url: str) -> str:
2727
else:
2828
msg = f"non-local file URIs are not supported on this platform: {url!r}"
2929
raise ValueError(msg)
30-
path = url2pathname(netloc + path)
31-
return path
30+
return url2pathname(netloc + path)
3231

3332

3433
def handle_binary_option(value: str, target: set[str], other: set[str]) -> None:

src/tox/tox_env/python/pip/req_file.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ def _normalize_raw(raw: str) -> str:
7070
# for tox<4 supporting requirement/constraint files via -rreq.txt/-creq.txt
7171
lines.append(PythonDeps._normalize_line(line))
7272
adjusted = "\n".join(lines)
73-
raw = f"{adjusted}\n" if raw.endswith("\\\n") else adjusted # preserve trailing newline if input has it
74-
return raw
73+
return f"{adjusted}\n" if raw.endswith("\\\n") else adjusted # preserve trailing newline if input has it
7574

7675
@staticmethod
7776
def _normalize_line(line: str) -> str:

0 commit comments

Comments
 (0)