Skip to content

Commit 2b1c468

Browse files
committed
resolve a few other issues
1 parent c3faae0 commit 2b1c468

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/shecan/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Resolver(NamedTuple):
1717
ip: str = None
1818

1919

20-
def add(ips) -> int:
20+
def add(ips: tuple[str]) -> None:
2121
"""Add a DNS (a DNS object) to the dns database."""
2222
with ShecanConfig() as config:
2323
config.update(ips)
@@ -42,7 +42,7 @@ def current_dns() -> list[Resolver]:
4242
if sys.platform == "linux":
4343
with open("/etc/resolv.conf") as resovl_file:
4444
for line in resovl_file:
45-
line = line.strip()
45+
line = line.strip() # noqa: PLW2901
4646
if not line or line.startswith("#"):
4747
continue
4848
resolv_list.append(Resolver(*line.split()[:2]))

src/shecan/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def list_dns() -> None:
3434
print(tabulate(dns_servers, headers=["ID", "IP"], stralign="center"))
3535

3636

37-
def update_resolv_file(content) -> None:
37+
def update_resolv_file(content: list[str]) -> None:
3838
resolv_file = Path("/etc", "resolv.conf")
3939
tmp_resolv_file = Path(gettempdir()).joinpath("resolv.conf")
4040

src/shecan/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __enter__(self) -> Self:
3030
self._read_config()
3131
return self
3232

33-
def __exit__(self, *exceptions):
33+
def __exit__(self, *exceptions: object) -> None:
3434
with open(self.config_file, mode="w") as fp:
3535
self._parser.write(fp)
3636

src/shecan/log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import logging
2-
from typing import Any
2+
from argparse import Namespace
33

44

5-
def setup_logging(args: Any) -> logging.StreamHandler:
5+
def setup_logging(args: Namespace) -> logging.StreamHandler:
66
console_handhler = logging.StreamHandler()
77
formatter = logging.Formatter("%(asctime)s %(levelname)s: %(message)s")
88
console_handhler.setFormatter(formatter)

0 commit comments

Comments
 (0)