run mypy at build time & fix type errors
This commit is contained in:
parent
69da2a4df9
commit
6f5610bff9
2 changed files with 9 additions and 2 deletions
|
|
@ -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'
|
||||||
|
|
|
||||||
|
|
@ -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 " "
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue