Skip to content

Commit 7e26184

Browse files
committed
chore: add mypy pre-commit
1 parent 823e446 commit 7e26184

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ repos:
1919
rev: v1.7.5
2020
hooks:
2121
- id: docformatter
22+
- repo: https://github.com/pre-commit/mirrors-mypy
23+
rev: v1.11.1
24+
hooks:
25+
- id: mypy

doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
version = metadata.version("scim2_cli")
3535
language = "en"
36-
exclude_patterns = []
3736
pygments_style = "sphinx"
3837
todo_include_todos = True
3938
toctree_collapse = False

scim2_cli/utils.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import json
22
from enum import Enum
3+
from typing import Dict
4+
from typing import List
35

46
DOC_URL = "https://scim2-cli.readthedocs.io/"
57
INDENTATION_SIZE = 4
@@ -29,7 +31,13 @@ def formatted_payload(obj, indent):
2931
return json.dumps(obj, indent=indent)
3032

3133

32-
def split_headers(headers):
34+
def split_headers(headers: List[str]) -> Dict[str, str]:
35+
"""Make a dict from header strings.
36+
37+
['Authorization: Bearer token'] → '{"Authorization": "Bearer
38+
token"}'
39+
"""
40+
3341
return {
3442
header[: header.index(":")].strip(): header[header.index(":") + 1 :].strip()
3543
for header in headers

0 commit comments

Comments
 (0)