dh-tech / undate-python

A Python library for working with fuzzy, partial, or otherwise uncertain dates
Apache License 2.0
6 stars 1 forks source link

Type cleanup based on errors reported by mypy #66

Closed rlskoeser closed 2 months ago

rlskoeser commented 8 months ago

per #29 — trying out mypy and updating our type annotations based on the reported errors (not all resolved)

I'm installing and checking manually for now:

pip install mypy
mypy --install-types
mypy src/

here are the errors being reported now, after the changes made in this branch:

src/undate/undate.py:145: error: "BaseDateFormat" not callable  [operator]
src/undate/undate.py:146: error: Incompatible types in assignment (expression has type "Optional[BaseDateFormat]", variable has type "BaseDateFormat")  [assignment]
src/undate/undate.py:246: error: Syntax error in type annotation  [syntax]
src/undate/undate.py:246: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn)
Found 3 errors in 1 file (checked 5 source files)
codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.66%. Comparing base (ff3ea6d) to head (ca8bdc8). Report is 12 commits behind head on develop.

:exclamation: Current head ca8bdc8 differs from pull request most recent head b679afa. Consider uploading reports for the commit b679afa to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #66 +/- ## =========================================== - Coverage 98.71% 98.66% -0.06% =========================================== Files 5 4 -1 Lines 234 224 -10 =========================================== - Hits 231 221 -10 Misses 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.