Following up on #37, a few minor details were left unfinished:
[ ] Set up a pre commit config to run tests/linting locally
[ ] Define any linting parameters
[ ] Setup code coverage to track how effective our current tests are
[ ] Setup Coverage reporting, potentially with a tool like codecov (based on the badge in the readme)
Linting:
What tools?
Python
Black is the basically defacto standard for python these days, normally a bit of tweaking is needed due to its highly opinionated defaults
A few defaults probably need to be changed, i.e. line length - default from black is PEP8's 79 characters, which I think is too short, I personally prefer 100 or 120 characters, which should still fit on most modern screens
Markdown
Prettier.io?
If we are to do this, do we at actions to enforce the conventions?
Code Coverage:
Since we use pytest, the obvious choice is to use their first party coverage tool, pytest-cov.
For reporting coverage, we could generate an html report and upload it as an artifact, find some tool that works in a workflow to export it in a way we can leave a commit comment/status, or use a 3rd party tool like codecov.
Pre-commit
I'm not a huge fan of running tests in a pre-commit hook, rather in a pre-push hook, especially as more tests are added, time can build up and it can slow down commits (though, that may not be an issue here, the tests seem to run quickly for me), though I cannot deny it being more useful than having to open up a terminal and run things like poetry run pytest, poetry run black, etc for any tools being used.
Following up on #37, a few minor details were left unfinished:
Linting:
Code Coverage:
Since we use pytest, the obvious choice is to use their first party coverage tool,
pytest-cov
.For reporting coverage, we could generate an html report and upload it as an artifact, find some tool that works in a workflow to export it in a way we can leave a commit comment/status, or use a 3rd party tool like codecov.
Pre-commit
I'm not a huge fan of running tests in a pre-commit hook, rather in a pre-push hook, especially as more tests are added, time can build up and it can slow down commits (though, that may not be an issue here, the tests seem to run quickly for me), though I cannot deny it being more useful than having to open up a terminal and run things like
poetry run pytest
,poetry run black
, etc for any tools being used.