This isn’t my main GitHub account, so Contact me on Reddit if you do use those services, otherwise I probably won’t see it for weeks/months.
How to Contribute¶
# noqa (for PEP8, PEP257) and
# pragma: no cover (for coverage)
comments may be added in to sections of code where these guidelines can’t be
adhered to, for some reason.
Please note the following additional conventions, which can be found in the code:
- Two blank lines between the top-level docstring and the imports.
- Two blank lines between the imports and the code itself.
Documentation and Docstrings¶
See Documentation for info on how to build the docs.
- Both are written in reST, using Sphinx.
Tests should ideally cover all code in the package (giving 100% coverage), unless told not to test specific sections (in which case the offending parts should have the appropriate “ignore” comments next to them). To run tests, see Test Suite.
- Tests use the
DUMMY_LIST(found in tests/mocks/__init__.py) where possible, to reduce the number of requests sent over to MAL. This should ideally be used anywhere where the aim of the test is NOT to test that a users’ list can be retrieved from the site.
- The user
testmalacct0000has been created to be used by tests that check if a users’ list can be retrieved from MAL. The list and scores should not change, so any constants that can be extracted from the list and be tested against should be added to tests/const.py.
- A wait of
const.WAIT_BETWEEN_REQUESTSmust be added before any request to MAL, to abide by its rate limit.
- A mock
malaffinity.endpoints.myanimelistfunction may be added to
tests/mocks/__init__.py, if the
DUMMY_LISTneeds to be modified in any way for a test. If this is not the case, the endpoint should be patched with
mocks.mock_myanimelist_endpoint, which will just return the list.
That’s it, I guess. Contact me if you need anything.