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 Aug 2, 2024
1 parent c4bc51c commit dcaf733
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(https://github.com/python/mypy/issues/15238): Switch back to PEP 695 type alias when supported by mypy
DiffLine: TypeAlias = tuple[Literal[" ", "+", "-"], Availability] # noqa: UP040


@frozen
Expand Down

0 comments on commit dcaf733

Please sign in to comment.