Closed davidverweij closed 3 years ago
This pull request fixes 9 alerts when merging 833a99c7ae22edf5e5c3ee8a16dbcfc12ced49ad into a6ba0ad3e9040a0c6efd78ca4c2caf4adcf28264 - view on LGTM.com
fixed alerts:
This pull request fixes 9 alerts when merging e7fdbf100c1eb71f79d3b3d04f8a3b9e4f8c276e into a6ba0ad3e9040a0c6efd78ca4c2caf4adcf28264 - view on LGTM.com
fixed alerts:
This pull request fixes 9 alerts when merging b349d2fd487456563b2449ea294d14126d9fc4af into a6ba0ad3e9040a0c6efd78ca4c2caf4adcf28264 - view on LGTM.com
fixed alerts:
LGTM and pytest
via nox now returns correct state
This PR implements linting, typing and tests such that upcoming contributions are sound - this should help with error prevention in the long run.
More specifically, changes include (as suggested in #22):
nox
for test automationnox
session to run:flake8
lintingpytests
unit testingmypy
type testingisort
import statement orderingblack
automatic code formattingpre-commit
to run (and mandate passes) for these, exceptpytests
.As expected, these prompted a breadth of required changes which are all resolved. A few simply cannot due to our setup, and have been added to config files for
mypy
andflake8
to be ignored.Test
poetry install
to include dev dependenciespoetry shell
)pre-commit install
poetry run nox -rs tests
. This runs all tests (and currently fails a few on the inventory part). Note that it currently circumvents `install_withconstraints. See issue #36.poetry run nox -rs mypy
. This checks typing. Note that a few tests are currently excluded (see issue #35).poetry run nox -rs isort
. This sorts import statements alphabetically and by sections (i.e. global, 3rd party and local)poetry run nox -rs lint
. This runs various linting checks using flake8. Note that a few errors are ignored for our use case - see mypy.ini in root.poetry run nox -rs black
. This checks and changes various formatting following black standards.To Do
As referred to above, a few issues and todo's arose from the adoption of linting, tests and typing. These are documented in separate issues to work on.