summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--doc/config.rst3
-rw-r--r--doc/invocation.rst3
-rw-r--r--sphinx/config.py2
-rw-r--r--sphinx/environment.py9
5 files changed, 14 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 59c44abc..a9bccfea 100644
--- a/CHANGES
+++ b/CHANGES
@@ -96,6 +96,9 @@ Bugs fixed
* #1017: Be helpful and tell the user when the argument to :rst:dir:`option`
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
-------------
diff --git a/doc/config.rst b/doc/config.rst
index 714df6eb..78bca929 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -236,7 +236,8 @@ General configuration
A list of ``(type, target)`` tuples (by default empty) that should be ignored
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
diff --git a/doc/invocation.rst b/doc/invocation.rst
index 4f4d81ac..97b1e1b7 100644
--- a/doc/invocation.rst
+++ b/doc/invocation.rst
@@ -149,7 +149,8 @@ The :program:`sphinx-build` script has several options:
.. option:: -n
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
diff --git a/sphinx/config.py b/sphinx/config.py
index 9ea2226e..df74e914 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -72,7 +72,7 @@ class Config(object):
primary_domain = ('py', 'env'),
needs_sphinx = (None, None),
nitpicky = (False, 'env'),
- nitpick_ignore = ([], 'env'),
+ nitpick_ignore = ([], 'html'),
# HTML options
html_theme = ('default', 'html'),
diff --git a/sphinx/environment.py b/sphinx/environment.py
index 919ae710..a319ef3c 100644
--- a/sphinx/environment.py
+++ b/sphinx/environment.py
@@ -177,9 +177,6 @@ class BuildEnvironment:
# this is to invalidate old pickles
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
# the source suffix.
@@ -440,6 +437,9 @@ class BuildEnvironment:
self.find_files(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)
# allow user intervention as well
@@ -1385,6 +1385,9 @@ class BuildEnvironment:
dtype = domain and '%s:%s' % (domain.name, typ) or typ
if (dtype, target) in self._nitpick_ignore:
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:
return
if domain and typ in domain.dangling_warnings: