Skip to content

Commit 88103ea

Browse files
committed
Fix some linting errors
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 97c1259 commit 88103ea

File tree

1 file changed

+6
-7
lines changed
  • src/frequenz/repo/config/nox

1 file changed

+6
-7
lines changed

src/frequenz/repo/config/nox/util.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import pathlib
1212
import tomllib
13-
from collections.abc import Iterable, Mapping, Set
13+
from collections.abc import Iterable, Mapping
1414
from typing import TypeVar
1515

1616
_T = TypeVar("_T")
@@ -36,14 +36,13 @@ def replace(iterable: Iterable[_T], replacements: Mapping[_T, _T], /) -> Iterabl
3636
3737
Args:
3838
iterable: The iterable to replace elements in.
39-
old: The elements to replace.
40-
new: The elements to replace with.
39+
replacements: A mapping of elements to replace with other elements.
4140
42-
Returns:
43-
An iterable with the elements in `iterable` replaced.
41+
Yields:
42+
The next element in the iterable, with the replacements applied.
4443
4544
Example:
46-
>>> assert list(replace([1, 2, 3], old={1, 2}, new={4, 5})) == [4, 5, 3]
45+
>>> assert list(replace([1, 2, 3], {1: 4, 2: 5})) == [4, 5, 3]
4746
"""
4847
for item in iterable:
4948
if item in replacements:
@@ -210,7 +209,7 @@ def discover_paths() -> list[str]:
210209
with open("pyproject.toml", "rb") as toml_file:
211210
data = tomllib.load(toml_file)
212211

213-
testpaths = (
212+
testpaths: list[str] = (
214213
data.get("tool", {})
215214
.get("pytest", {})
216215
.get("ini_options", {})

0 commit comments

Comments
 (0)