mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#1345: Fix two bugs with :confval:nitpick_ignore
; now you don't have to
remove the store environment for changes to have effect.
This commit is contained in:
parent
ae234c3ded
commit
123572e1db
3
CHANGES
3
CHANGES
@ -79,6 +79,9 @@ Bugs fixed
|
|||||||
* #1017: Be helpful and tell the user when the argument to :rst:dir:`option`
|
* #1017: Be helpful and tell the user when the argument to :rst:dir:`option`
|
||||||
does not match the required format.
|
does not match the required format.
|
||||||
|
|
||||||
|
* #1345: Fix two bugs with :confval:`nitpick_ignore`; now you don't have to
|
||||||
|
remove the store environment for changes to have effect.
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
@ -236,7 +236,8 @@ General configuration
|
|||||||
|
|
||||||
A list of ``(type, target)`` tuples (by default empty) that should be ignored
|
A list of ``(type, target)`` tuples (by default empty) that should be ignored
|
||||||
when generating warnings in "nitpicky mode". Note that ``type`` should
|
when generating warnings in "nitpicky mode". Note that ``type`` should
|
||||||
include the domain name. An example entry would be ``('py:func', 'int')``.
|
include the domain name if present. Example entries would be ``('py:func',
|
||||||
|
'int')`` or ``('envvar', 'LD_LIBRARY_PATH')``.
|
||||||
|
|
||||||
.. versionadded:: 1.1
|
.. versionadded:: 1.1
|
||||||
|
|
||||||
|
@ -140,7 +140,8 @@ The :program:`sphinx-build` script has several options:
|
|||||||
.. option:: -n
|
.. option:: -n
|
||||||
|
|
||||||
Run in nit-picky mode. Currently, this generates warnings for all missing
|
Run in nit-picky mode. Currently, this generates warnings for all missing
|
||||||
references.
|
references. See the config value :confval:`nitpick_ignore` for a way to
|
||||||
|
exclude some references as "known missing".
|
||||||
|
|
||||||
.. option:: -N
|
.. option:: -N
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ class Config(object):
|
|||||||
primary_domain = ('py', 'env'),
|
primary_domain = ('py', 'env'),
|
||||||
needs_sphinx = (None, None),
|
needs_sphinx = (None, None),
|
||||||
nitpicky = (False, 'env'),
|
nitpicky = (False, 'env'),
|
||||||
nitpick_ignore = ([], 'env'),
|
nitpick_ignore = ([], 'html'),
|
||||||
|
|
||||||
# HTML options
|
# HTML options
|
||||||
html_theme = ('default', 'html'),
|
html_theme = ('default', 'html'),
|
||||||
|
@ -177,9 +177,6 @@ class BuildEnvironment:
|
|||||||
# this is to invalidate old pickles
|
# this is to invalidate old pickles
|
||||||
self.version = ENV_VERSION
|
self.version = ENV_VERSION
|
||||||
|
|
||||||
# make this a set for faster testing
|
|
||||||
self._nitpick_ignore = set(self.config.nitpick_ignore)
|
|
||||||
|
|
||||||
# All "docnames" here are /-separated and relative and exclude
|
# All "docnames" here are /-separated and relative and exclude
|
||||||
# the source suffix.
|
# the source suffix.
|
||||||
|
|
||||||
@ -440,6 +437,9 @@ class BuildEnvironment:
|
|||||||
self.find_files(config)
|
self.find_files(config)
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
|
# this cache also needs to be updated every time
|
||||||
|
self._nitpick_ignore = set(self.config.nitpick_ignore)
|
||||||
|
|
||||||
added, changed, removed = self.get_outdated_files(config_changed)
|
added, changed, removed = self.get_outdated_files(config_changed)
|
||||||
|
|
||||||
# allow user intervention as well
|
# allow user intervention as well
|
||||||
@ -1385,6 +1385,9 @@ class BuildEnvironment:
|
|||||||
dtype = domain and '%s:%s' % (domain.name, typ) or typ
|
dtype = domain and '%s:%s' % (domain.name, typ) or typ
|
||||||
if (dtype, target) in self._nitpick_ignore:
|
if (dtype, target) in self._nitpick_ignore:
|
||||||
warn = False
|
warn = False
|
||||||
|
# for "std" types also try without domain name
|
||||||
|
if domain.name == 'std' and (typ, target) in self._nitpick_ignore:
|
||||||
|
warn = False
|
||||||
if not warn:
|
if not warn:
|
||||||
return
|
return
|
||||||
if domain and typ in domain.dangling_warnings:
|
if domain and typ in domain.dangling_warnings:
|
||||||
|
Loading…
Reference in New Issue
Block a user