Measure docstring coverage of Python packages with GitHub Actions
- Copy
.github/workflows/docstr-cov.yml
and.docstr.yaml
to your repository. - Tweak the configuration file following the package documentation.
- Login to https://jsonbin.org and store the API key as a repository secret named
JSONBIN_APIKEY
. - The workflow will fail if the coverage is lower than the score of the base branch (on
pull_request
) or the previous commit (onpush
), and files that made the job fail will be blamed. - Pushing to
main
branch updates the current coverage of the project by updating a nice badge. - You can change the color range of the badge by tweaking the
RANGE
variable at the top of the workflow. For example,50..75
means that coverage below50
will display a red badge, and above75
a green one. - Remember to add the badge to your README.md
Make changes to example/base.py
and see the workflow in action.
- Hunter McGushion, and the contributors of the package
docstr-coverage
. - Remy Sharp, creator of jsonbin.org.
- TARDIS-SN collaboration, for letting me have fun with these tools.