Skip to content

Commit

Permalink
Add mypy to pre-commit config
Browse files Browse the repository at this point in the history
TODO: Switch back to PEP 695 type alias when supported by mypy (python/mypy#15238)
  • Loading branch information
injust committed Jul 7, 2024
1 parent c4bc51c commit f6a997d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ repos:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
args: [--disable-error-code=import-untyped]
additional_dependencies:
[anyio, attrs, httpx, loguru, python-dateutil, tenacity]
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from asyncio import CancelledError
from collections.abc import Callable, Iterable, Sequence
from itertools import product
from typing import Literal, Self
from typing import Literal, Self, TypeAlias

import httpx
from anyio import create_task_group, run, sleep
Expand All @@ -28,7 +28,8 @@
from flights import Availability
from utils import beep, httpx_client, pretty_printer

type DiffLine = tuple[Literal[" ", "+", "-"], Availability]
# TODO: Switch back to PEP 695 type alias when supported by mypy (https://github.com/python/mypy/issues/15238)
DiffLine: TypeAlias = tuple[Literal[" ", "+", "-"], Availability]


@frozen
Expand Down

0 comments on commit f6a997d

Please sign in to comment.