From 0aed59a6c002c94e12a89b6c1400ecd0420dc2f9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 19 Apr 2018 07:08:17 -0400 Subject: Document COVERAGE_RCFILE --- CHANGES.rst | 2 +- coverage/cmdline.py | 9 +++++---- doc/config.rst | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 85db3b2..8028f1f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -18,7 +18,7 @@ Unreleased (might become 4.6) ----------------------------- - The location of the configuration file can now be specified with a - `COVERAGE_RCFILE` environment variable, as requested in `issue 650`_. + ``COVERAGE_RCFILE`` environment variable, as requested in `issue 650`_. - A new warning (already-imported) is issued if measurable files have already been imported before coverage.py started measurement. See diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 5baf07a..ea86b44 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -44,7 +44,7 @@ class Opts(object): ) debug = optparse.make_option( '', '--debug', action='store', metavar="OPTS", - help="Debug options, separated by commas", + help="Debug options, separated by commas. [env: COVERAGE_DEBUG]", ) directory = optparse.make_option( '-d', '--directory', action='store', metavar="DIR", @@ -116,8 +116,9 @@ class Opts(object): rcfile = optparse.make_option( '', '--rcfile', action='store', help=( - "Specify configuration file. " - "By default '.coveragerc', 'setup.cfg' and 'tox.ini' are tried." + "Specify configuration file. " + "By default '.coveragerc', 'setup.cfg' and 'tox.ini' are tried. " + "[env: COVERAGE_RCFILE]" ), ) source = optparse.make_option( @@ -127,7 +128,7 @@ class Opts(object): timid = optparse.make_option( '', '--timid', action='store_true', help=( - "Use a simpler but slower trace method. Try this if you get " + "Use a simpler but slower trace method. Try this if you get " "seemingly impossible results!" ), ) diff --git a/doc/config.rst b/doc/config.rst index c1fb4b1..062aa74 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -33,8 +33,9 @@ configuration file are tied to your source code and how it should be measured, so it should be stored with your source, and checked into source control, rather than put in your home directory. -A different name for the configuration file can be specified with the -``--rcfile=FILE`` command line option. +A different location for the configuration file can be specified with the +``--rcfile=FILE`` command line option or with the ``COVERAGE_RCFILE`` +environment variable. Coverage.py will read settings from other usual configuration files if no other configuration file is used. It will automatically read from "setup.cfg" or -- cgit v1.2.1