diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 97b24e7..15d6bc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,3 +32,10 @@ repos: args: [ --fix, --preview ] # Run the formatter. - id: ruff-format +- repo: local + hooks: + - id: mypy + name: Run the mypy type linter + language: system + types: [python] + entry: 'make mypy' diff --git a/src/ttotp/__main__.py b/src/ttotp/__main__.py index 9f0e0c4..5bf80f8 100755 --- a/src/ttotp/__main__.py +++ b/src/ttotp/__main__.py @@ -244,8 +244,8 @@ class TOTPData: ) -def search_preprocess(s): - def replace_escape_sequence(m): +def search_preprocess(s: str) -> str: + def replace_escape_sequence(m: re.Match[str]) -> str: s = m.group(0) if s == "\\ ": return " "