I welcome contributions to coverage.py. Over the years, dozens of people have
provided patches of various sizes to add features or fix bugs. This page
should have all the information you need to make a contribution.

One source of history or ideas are the bug reports against coverage.py.
There you can find ideas for requested features, or the remains of rejected
ideas.

If you have an idea for coverage.py, run it by me before you begin writing
code. This way, I can get you going in the right direction, or point you to
previous work in the area. Things are not always as straightforward as they
seem, and having the benefit of lessons learned by those before you can save
you frustration.

(Optional, but recommended) Create a virtualenv to work in, and activate
it.

Clone the repo:

$ hg clone https://bitbucket.org/ned/coveragepy
$cd coveragepy

Install the requirements:

$ pip install -r requirements/dev.pip

Install a number of versions of Python. Coverage.py supports a wide range
of Python versions. The more you can test with, the more easily your code
can be used as-is. If you only have one version, that’s OK too, but may
mean more work integrating your contribution.

The source is pylint-clean, even if it’s because there are pragmas quieting
some warnings. Please try to keep it that way, but don’t let pylint warnings
keep you from sending patches. I can clean them up.

Lines should be kept to a 100-character maximum length. I recommend an
editorconfig.org plugin for your editor of choice.

Other style questions are best answered by looking at the existing code.
Formatting of docstrings, comments, long lines, and so on, should match the
code that already exists.

Coverage.py can measure itself, but it’s complicated. The process has been
packaged up to make it easier:

$ make metacov metahtml

Then look at htmlcov/index.html. Note that due to the recursive nature of
coverage.py measuring itself, there are some parts of the code that will never
appear as covered, even though they are executed.