run mypy at build time & fix type errors

This commit is contained in:
Jeff Epler 2023-12-10 14:55:58 -06:00
parent 69da2a4df9
commit 6f5610bff9
No known key found for this signature in database
GPG key ID: D5BF15AB975AB4DE
2 changed files with 9 additions and 2 deletions

View file

@ -32,3 +32,10 @@ repos:
args: [ --fix, --preview ] args: [ --fix, --preview ]
# Run the formatter. # Run the formatter.
- id: ruff-format - id: ruff-format
- repo: local
hooks:
- id: mypy
name: Run the mypy type linter
language: system
types: [python]
entry: 'make mypy'

View file

@ -244,8 +244,8 @@ class TOTPData:
) )
def search_preprocess(s): def search_preprocess(s: str) -> str:
def replace_escape_sequence(m): def replace_escape_sequence(m: re.Match[str]) -> str:
s = m.group(0) s = m.group(0)
if s == "\\ ": if s == "\\ ":
return " " return " "