From d8646c51b47fbd3e90bb591e2b2f64b116393934 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Tue, 15 Oct 2024 17:55:13 -0700 Subject: [PATCH] pyright lint for rdtypes --- dns/rdtypes/ANY/AMTRELAY.py | 1 + dns/rdtypes/ANY/CERT.py | 2 +- dns/rdtypes/ANY/L32.py | 1 + dns/rdtypes/ANY/L64.py | 1 + dns/rdtypes/ANY/LOC.py | 4 ++-- dns/rdtypes/ANY/NID.py | 1 + dns/rdtypes/ANY/NSEC3.py | 1 + dns/rdtypes/ANY/OPENPGPKEY.py | 2 +- dns/rdtypes/ANY/RRSIG.py | 4 ++-- dns/rdtypes/ANY/SSHFP.py | 4 +++- dns/rdtypes/ANY/ZONEMD.py | 4 +++- dns/rdtypes/CH/A.py | 1 + dns/rdtypes/IN/DHCID.py | 2 +- dns/rdtypes/IN/IPSECKEY.py | 3 ++- pyproject.toml | 3 --- 15 files changed, 21 insertions(+), 13 deletions(-) diff --git a/dns/rdtypes/ANY/AMTRELAY.py b/dns/rdtypes/ANY/AMTRELAY.py index ed2b072b..9c866da6 100644 --- a/dns/rdtypes/ANY/AMTRELAY.py +++ b/dns/rdtypes/ANY/AMTRELAY.py @@ -19,6 +19,7 @@ import dns.exception import dns.immutable +import dns.rdata import dns.rdtypes.util diff --git a/dns/rdtypes/ANY/CERT.py b/dns/rdtypes/ANY/CERT.py index f369cc85..d37c5cb0 100644 --- a/dns/rdtypes/ANY/CERT.py +++ b/dns/rdtypes/ANY/CERT.py @@ -88,7 +88,7 @@ def to_text(self, origin=None, relativize=True, **kw): certificate_type, self.key_tag, dns.dnssectypes.Algorithm.to_text(self.algorithm), - dns.rdata._base64ify(self.certificate, **kw), + dns.rdata._base64ify(self.certificate, **kw), # pyright: ignore ) @classmethod diff --git a/dns/rdtypes/ANY/L32.py b/dns/rdtypes/ANY/L32.py index 09804c2d..f51e5c79 100644 --- a/dns/rdtypes/ANY/L32.py +++ b/dns/rdtypes/ANY/L32.py @@ -3,6 +3,7 @@ import struct import dns.immutable +import dns.ipv4 import dns.rdata diff --git a/dns/rdtypes/ANY/L64.py b/dns/rdtypes/ANY/L64.py index fb76808e..a47da19e 100644 --- a/dns/rdtypes/ANY/L64.py +++ b/dns/rdtypes/ANY/L64.py @@ -3,6 +3,7 @@ import struct import dns.immutable +import dns.rdata import dns.rdtypes.util diff --git a/dns/rdtypes/ANY/LOC.py b/dns/rdtypes/ANY/LOC.py index 1153cf03..fab3a99b 100644 --- a/dns/rdtypes/ANY/LOC.py +++ b/dns/rdtypes/ANY/LOC.py @@ -143,13 +143,13 @@ def __init__( if isinstance(latitude, float): latitude = _float_to_tuple(latitude) _check_coordinate_list(latitude, -90, 90) - self.latitude = tuple(latitude) + self.latitude = tuple(latitude) # pyright: ignore if isinstance(longitude, int): longitude = float(longitude) if isinstance(longitude, float): longitude = _float_to_tuple(longitude) _check_coordinate_list(longitude, -180, 180) - self.longitude = tuple(longitude) + self.longitude = tuple(longitude) # pyright: ignore self.altitude = float(altitude) self.size = float(size) self.horizontal_precision = float(hprec) diff --git a/dns/rdtypes/ANY/NID.py b/dns/rdtypes/ANY/NID.py index 2f649178..fa0dad5c 100644 --- a/dns/rdtypes/ANY/NID.py +++ b/dns/rdtypes/ANY/NID.py @@ -3,6 +3,7 @@ import struct import dns.immutable +import dns.rdata import dns.rdtypes.util diff --git a/dns/rdtypes/ANY/NSEC3.py b/dns/rdtypes/ANY/NSEC3.py index d71302b7..d9af1115 100644 --- a/dns/rdtypes/ANY/NSEC3.py +++ b/dns/rdtypes/ANY/NSEC3.py @@ -21,6 +21,7 @@ import dns.exception import dns.immutable +import dns.name import dns.rdata import dns.rdatatype import dns.rdtypes.util diff --git a/dns/rdtypes/ANY/OPENPGPKEY.py b/dns/rdtypes/ANY/OPENPGPKEY.py index 4d7a4b6c..ac1841cc 100644 --- a/dns/rdtypes/ANY/OPENPGPKEY.py +++ b/dns/rdtypes/ANY/OPENPGPKEY.py @@ -34,7 +34,7 @@ def __init__(self, rdclass, rdtype, key): self.key = self._as_bytes(key) def to_text(self, origin=None, relativize=True, **kw): - return dns.rdata._base64ify(self.key, chunksize=None, **kw) + return dns.rdata._base64ify(self.key, chunksize=None, **kw) # pyright: ignore @classmethod def from_text( diff --git a/dns/rdtypes/ANY/RRSIG.py b/dns/rdtypes/ANY/RRSIG.py index 8beb4237..dc486f06 100644 --- a/dns/rdtypes/ANY/RRSIG.py +++ b/dns/rdtypes/ANY/RRSIG.py @@ -103,7 +103,7 @@ def to_text(self, origin=None, relativize=True, **kw): posixtime_to_sigtime(self.inception), self.key_tag, self.signer.choose_relativity(origin, relativize), - dns.rdata._base64ify(self.signature, **kw), + dns.rdata._base64ify(self.signature, **kw), # pyright: ignore ) @classmethod @@ -154,4 +154,4 @@ def from_wire_parser(cls, rdclass, rdtype, parser, origin=None): header = parser.get_struct("!HBBIIIH") signer = parser.get_name(origin) signature = parser.get_remaining() - return cls(rdclass, rdtype, *header, signer, signature) + return cls(rdclass, rdtype, *header, signer, signature) # pyright: ignore diff --git a/dns/rdtypes/ANY/SSHFP.py b/dns/rdtypes/ANY/SSHFP.py index d2c4b073..904a1b9e 100644 --- a/dns/rdtypes/ANY/SSHFP.py +++ b/dns/rdtypes/ANY/SSHFP.py @@ -43,7 +43,9 @@ def to_text(self, origin=None, relativize=True, **kw): return "%d %d %s" % ( self.algorithm, self.fp_type, - dns.rdata._hexify(self.fingerprint, chunksize=chunksize, **kw), + dns.rdata._hexify( + self.fingerprint, chunksize=chunksize, **kw # pyright: ignore + ), ) @classmethod diff --git a/dns/rdtypes/ANY/ZONEMD.py b/dns/rdtypes/ANY/ZONEMD.py index c90e3ee1..63469e4c 100644 --- a/dns/rdtypes/ANY/ZONEMD.py +++ b/dns/rdtypes/ANY/ZONEMD.py @@ -40,7 +40,9 @@ def to_text(self, origin=None, relativize=True, **kw): self.serial, self.scheme, self.hash_algorithm, - dns.rdata._hexify(self.digest, chunksize=chunksize, **kw), + dns.rdata._hexify( + self.digest, chunksize=chunksize, **kw # pyright: ignore + ), ) @classmethod diff --git a/dns/rdtypes/CH/A.py b/dns/rdtypes/CH/A.py index 832e8d3a..e3e07521 100644 --- a/dns/rdtypes/CH/A.py +++ b/dns/rdtypes/CH/A.py @@ -18,6 +18,7 @@ import struct import dns.immutable +import dns.rdata import dns.rdtypes.mxbase diff --git a/dns/rdtypes/IN/DHCID.py b/dns/rdtypes/IN/DHCID.py index 723492fa..8de8cdf1 100644 --- a/dns/rdtypes/IN/DHCID.py +++ b/dns/rdtypes/IN/DHCID.py @@ -35,7 +35,7 @@ def __init__(self, rdclass, rdtype, data): self.data = self._as_bytes(data) def to_text(self, origin=None, relativize=True, **kw): - return dns.rdata._base64ify(self.data, **kw) + return dns.rdata._base64ify(self.data, **kw) # pyright: ignore @classmethod def from_text( diff --git a/dns/rdtypes/IN/IPSECKEY.py b/dns/rdtypes/IN/IPSECKEY.py index e3a66157..ce37cb7f 100644 --- a/dns/rdtypes/IN/IPSECKEY.py +++ b/dns/rdtypes/IN/IPSECKEY.py @@ -20,6 +20,7 @@ import dns.exception import dns.immutable +import dns.rdata import dns.rdtypes.util @@ -53,7 +54,7 @@ def to_text(self, origin=None, relativize=True, **kw): self.gateway_type, self.algorithm, gateway, - dns.rdata._base64ify(self.key, **kw), + dns.rdata._base64ify(self.key, **kw), # pyright: ignore ) @classmethod diff --git a/pyproject.toml b/pyproject.toml index 75530baa..6cf4ecec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -123,9 +123,6 @@ exclude = [ "dns/_*_backend.py", "dns/dnssecalgs/*.py", "dns/quic/*.py", - "dns/rdtypes/ANY/*.py", - "dns/rdtypes/CH/*.py", - "dns/rdtypes/IN/*.py", "examples/*.py", "tests/*.py", ] # (mostly) temporary!