fix mypy issues
check/lint python code with hatch / check-python-hatch (push) Successful in 21s Details

This commit is contained in:
Ivan Schaller 2024-01-09 23:07:04 +01:00
parent efa08db811
commit 988502a499
2 changed files with 5 additions and 6 deletions

View File

@ -43,12 +43,9 @@ create_reqs:
lint:
just show_system_info
just test_shfmt
just test_shfmt
@hatch run lint:style
@hatch run lint:typing
format:
just show_system_info
just format_shfmt
@hatch run lint:fmt

View File

@ -16,7 +16,7 @@ class NetBoxDNSSource(octodns.source.base.BaseSource):
SUPPORTS_GEO = False
SUPPORTS_DYNAMIC = False
SUPPORTS: frozenset = {
SUPPORTS: set[str] = {
"A",
"AAAA",
"AFSDB",
@ -64,7 +64,7 @@ class NetBoxDNSSource(octodns.source.base.BaseSource):
self.log.debug(f"__init__: {id=}, {url=}, {view=}, {replace_duplicates=}, {make_absolute=}")
super().__init__(id)
self._api = pynetbox.core.api.Api(url, token)
self._nb_view = {} if view is False else self._get_view(view)
self._nb_view = self._get_view(view)
self._ttl = ttl
self.replace_duplicates = replace_duplicates
self.make_absolute = make_absolute
@ -74,7 +74,9 @@ class NetBoxDNSSource(octodns.source.base.BaseSource):
return value
return value + "."
def _get_view(self, view: str | Literal[False]) -> dict[str, int | str]:
def _get_view(self, view: str | None | Literal[False]) -> dict[str, int | str]:
if view is False:
return {}
if view is None:
return {"view": "null"}