Update pre-commit hooks.

This commit is contained in:
Dain Nilsson 2023-07-06 11:59:30 +02:00
parent ed9f50a117
commit 5575d5838c
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
5 changed files with 9 additions and 7 deletions

View File

@ -1,19 +1,19 @@
repos:
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
rev: 1.7.5
hooks:
- id: bandit
exclude: ^tests/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.4.1
hooks:
- id: mypy
files: ^fido2/

View File

@ -126,7 +126,6 @@ def _read_descriptor(vid, pid, name, serial, path):
def _enumerate():
for uhid in glob.glob(devdir + "uhid?*"):
index = uhid[len(devdir) + len("uhid") :]
if not index.isdigit():
continue

View File

@ -309,7 +309,6 @@ class Fido2Server:
challenge: Optional[bytes] = None,
extensions=None,
) -> Tuple[CredentialRequestOptions, Any]:
"""Return a PublicKeyCredentialRequestOptions assertion object and the internal
state dictionary that needs to be passed as is to the corresponding
`authenticate_complete` call.

View File

@ -46,6 +46,8 @@ from typing import (
Any,
TypeVar,
Hashable,
ClassVar,
Dict,
get_type_hints,
)
import struct
@ -206,6 +208,8 @@ _T = TypeVar("_T", bound=Hashable)
class _DataClassMapping(Mapping[_T, Any]):
__dataclass_fields__: ClassVar[Dict[str, Field[Any]]]
def __post_init__(self):
hints = get_type_hints(type(self))
for f in fields(self):

View File

@ -160,7 +160,7 @@ class TestCborTestVectors(unittest.TestCase):
"""
def test_vectors(self):
for (data, value) in _TEST_VECTORS:
for data, value in _TEST_VECTORS:
try:
self.assertEqual(cbor.decode_from(bytes.fromhex(data)), (value, b""))
self.assertEqual(cbor.decode(bytes.fromhex(data)), value)