Skip to content

Commit

Permalink
Add mypy check in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
moi15moi committed Apr 29, 2024
1 parent 82fc617 commit df1f769
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 0 additions & 1 deletion font_collector/system_lang/mac_lang.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion font_collector/system_lang/windows_lang.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
Expand Down

0 comments on commit df1f769

Please sign in to comment.