diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index ed7ae1f..b4f6e0a 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -46,15 +46,20 @@ jobs: # We need to conserve mkvtoolnix in the PATH env variable. # From https://stackoverflow.com/a/73981698/15835974 - - name: Install pytest and coverage + - name: Install dependencies run: | pip install pytest pip install coverage + pip install mypy - name: Run tests run: | pytest + - name: Typecheck with mypy + run: | + mypy + - name: Generate coverage report run: | coverage run -m pytest diff --git a/README.md b/README.md index 841aea1..581f33d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # FontCollector [![FontCollector test code coverage](https://img.shields.io/codecov/c/github/moi15moi/FontCollector)](https://app.codecov.io/github/moi15moi/FontCollector) +[![FontCollector mypy verification](https://img.shields.io/badge/mypy-checked-blue)](https://github.com/moi15moi/FontCollector/actions?query=branch:main) FontCollector for Advanced SubStation Alpha file. This tool allows to recover and/or mux the fonts necessary in an mkv. diff --git a/font_collector/system_lang/mac_lang.py b/font_collector/system_lang/mac_lang.py index c6d187b..2aac2cb 100644 --- a/font_collector/system_lang/mac_lang.py +++ b/font_collector/system_lang/mac_lang.py @@ -15,7 +15,6 @@ def get_lang() -> str: if MacLang.__core_foundation is None: MacLang.__load__core_foundation() - assert MacLang.__core_foundation is not None # just to make mypy happy languages = MacLang.__core_foundation.CFLocaleCopyPreferredLanguages() diff --git a/font_collector/system_lang/windows_lang.py b/font_collector/system_lang/windows_lang.py index f57ec12..c19f281 100644 --- a/font_collector/system_lang/windows_lang.py +++ b/font_collector/system_lang/windows_lang.py @@ -1,6 +1,6 @@ from ..font.name import Name, PlatformID from .abc_system_lang import ABCSystemLang -from ctypes import windll, wintypes +from ctypes import windll, wintypes # type: ignore class WindowsLang(ABCSystemLang): diff --git a/pyproject.toml b/pyproject.toml index b22aede..cd7a166 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,12 @@ include = ["font_collector*"] [tool.mypy] warn_unused_configs = true +warn_unused_ignores = false strict = true +files = [ + # TODO Add the tests folder + "font_collector" +] [[tool.mypy.overrides]] module = "ass.*"