Support project level configuration across multiple directories

Issue #528 closed
Matt Clay created an issue

It would be useful to support use of a single .coveragerc configuration file in a project while being able to run coverage from any directory in the project.

Ideally, coverage would be able to find a .coveragerc in a parent directory, or possibly consult a COVERAGE_CONFIG environment variable for the full path to the configuration file. The existing --rcfile option could also be used.

In order for this to be useful, there also needs to be a way to tell coverage to evaluate the paths in the .coveragerc relative to its location instead of the current directory. Otherwise full paths are required, which doesn't work well for sharing the configuration as part of a code repository. Since the current behavior is to look in the current directory for the config, making the paths always relative to the config might work. Or perhaps an option like paths_relative_to_config = True in the config file?

Without this, it seems the only way to run coverage from multiple directories in a project is to have copies of the configuration file in each directory where it will be run, each with relative paths appropriate for that directory.

Comments (1)

  1. Log in to comment