Skip to content

Commit c5bd285

Browse files
Add tox.ini to the list of default config files
Because tox.ini is the latest addition to configuration files, it should have the lowest priority. List it last in the documentation, but use the reverse order in arguments of configparser.ConfigParser.read(), as I suspect this functions overwrites options from prior configuration files with options from subsequent configuration files.
1 parent bdcf7a6 commit c5bd285

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ Using a config file
9494
Command line options can also be specified in a config file.
9595

9696
When running ``codespell``, it will check in the current directory for a file
97-
named ``setup.cfg`` or ``.codespellrc`` (or a file specified via ``--config``),
98-
containing an entry named ``[codespell]``. Each command line argument can
99-
be specified in this file (without the preceding dashes), for example::
97+
named ``.codespellrc``, ``setup.cfg`` or ``tox.ini`` (or a file specified via
98+
``--config``), containing an entry named ``[codespell]``. Each command line
99+
argument can be specified in this file (without the preceding dashes), for
100+
example::
100101

101102
[codespell]
102103
skip = *.po,*.ts,./src/3rdParty,./src/Test

codespell_lib/_codespell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def parse_options(args):
400400
options = parser.parse_args(list(args))
401401

402402
# Load config files and look for ``codespell`` options.
403-
cfg_files = ['setup.cfg', '.codespellrc']
403+
cfg_files = ['tox.ini', 'setup.cfg', '.codespellrc']
404404
if options.config:
405405
cfg_files.append(options.config)
406406
config = configparser.ConfigParser()

0 commit comments

Comments
 (0)