Skip to content

Commit

Permalink
pyright lint for rdtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
rthalley committed Oct 16, 2024
1 parent 8fed826 commit d8646c5
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions dns/rdtypes/ANY/AMTRELAY.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import dns.exception
import dns.immutable
import dns.rdata
import dns.rdtypes.util


Expand Down
2 changes: 1 addition & 1 deletion dns/rdtypes/ANY/CERT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions dns/rdtypes/ANY/L32.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import struct

import dns.immutable
import dns.ipv4
import dns.rdata


Expand Down
1 change: 1 addition & 0 deletions dns/rdtypes/ANY/L64.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import struct

import dns.immutable
import dns.rdata
import dns.rdtypes.util


Expand Down
4 changes: 2 additions & 2 deletions dns/rdtypes/ANY/LOC.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions dns/rdtypes/ANY/NID.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import struct

import dns.immutable
import dns.rdata
import dns.rdtypes.util


Expand Down
1 change: 1 addition & 0 deletions dns/rdtypes/ANY/NSEC3.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import dns.exception
import dns.immutable
import dns.name
import dns.rdata
import dns.rdatatype
import dns.rdtypes.util
Expand Down
2 changes: 1 addition & 1 deletion dns/rdtypes/ANY/OPENPGPKEY.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions dns/rdtypes/ANY/RRSIG.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 3 additions & 1 deletion dns/rdtypes/ANY/SSHFP.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion dns/rdtypes/ANY/ZONEMD.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions dns/rdtypes/CH/A.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import struct

import dns.immutable
import dns.rdata
import dns.rdtypes.mxbase


Expand Down
2 changes: 1 addition & 1 deletion dns/rdtypes/IN/DHCID.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion dns/rdtypes/IN/IPSECKEY.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import dns.exception
import dns.immutable
import dns.rdata
import dns.rdtypes.util


Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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!

0 comments on commit d8646c5

Please sign in to comment.