Skip to content

Commit

Permalink
Revert the default type of nitpick_ignore[_regex] to list
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Apr 25, 2023
1 parent 60d8fa1 commit d2aa91f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Features added
Bugs fixed
----------

* #11355: Revert the default type of :confval:`nitpick_ignore` and
:confval:`nitpick_ignore_regex` to ``list``.

Testing
--------

Expand Down
4 changes: 2 additions & 2 deletions sphinx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ class Config:
'needs_extensions': ({}, None, []),
'manpages_url': (None, 'env', []),
'nitpicky': (False, None, []),
'nitpick_ignore': (set(), None, [set, list, tuple]),
'nitpick_ignore_regex': (set(), None, [set, list, tuple]),
'nitpick_ignore': ([], None, [set, list, tuple]),
'nitpick_ignore_regex': ([], None, [set, list, tuple]),
'numfig': (False, 'env', []),
'numfig_secnum_depth': (1, 'env', []),
'numfig_format': ({}, 'env', []), # will be initialized in init_numfig_format()
Expand Down
15 changes: 15 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,18 @@ def test_conf_py_no_language(tempdir):

# Then the language is coerced to English
assert cfg.language == "en"


def test_conf_py_nitpick_ignore_list(tempdir):
"""Regression test for #11355."""

# Given a conf.py file with no language attribute
(tempdir / 'conf.py').write_text("", encoding='utf-8')

# When we load conf.py into a Config object
cfg = Config.read(tempdir, {}, None)
cfg.init_values()

# Then the default nitpick_ignore[_regex] is an empty list
assert cfg.nitpick_ignore == []
assert cfg.nitpick_ignore_regex == []

0 comments on commit d2aa91f

Please sign in to comment.