Added type annotations to all methods to prevent bugs;
Added mypy package to --dev and updated noxfile.py to do static analysis by default;
Added mypy to pre-commit to validate code before commits, e.g. to PRs;
Made very minor tweak, e.g. removed uncommented code and bumped package version from 0.0.1 to 0.1.0 as a patch without minor version did not make semantic sense;
Running mypy identified a few issues, e.g. (i) reassigning path from a str to a path in convert(...) or (ii) the complexity of having the options list using multiple types.
How to test Changes
Pull down changes locally
Run poetry install && poetry shell
Run poetry run nox and observe that mypy runs and is a success
Verify that mypy pre-commit works: (i) remove a type hint from convert(); (ii) add the file to git; and (iii) try to make a commit. This should fail 👍
Addresses Issue #11
python run nox -r
successfullyWhat Changed (and why)?
--dev
and updatednoxfile.py
to do static analysis by default;0.0.1
to0.1.0
as a patch without minor version did not make semantic sense;Running mypy identified a few issues, e.g. (i) reassigning
path
from astr
to apath
inconvert(...)
or (ii) the complexity of having theoptions
list using multiple types.How to test Changes
poetry install && poetry shell
poetry run nox
and observe thatmypy
runs and is a successmypy
pre-commit works: (i) remove a type hint fromconvert()
; (ii) add the file to git; and (iii) try to make a commit. This should fail 👍Please review @davidverweij and closes #11.