summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2014-10-09 23:53:33 +0900
committershimizukawa <shimizukawa@gmail.com>2014-10-09 23:53:33 +0900
commit5c2f6935b4083841c53b1c2f21d8c76208c7d69b (patch)
treee5e2dbc129446e1600db39103c2fbe5d11204073
parent24366f0f01d011d82dae0dd1d39514247d8b21ee (diff)
downloadsphinx-5c2f6935b4083841c53b1c2f21d8c76208c7d69b.tar.gz
fix trailing space and long line
-rw-r--r--Makefile17
-rw-r--r--doc/domains.rst2
-rw-r--r--doc/extdev/appapi.rst2
-rw-r--r--sphinx/writers/texinfo.py6
-rw-r--r--tests/roots/test-autosummary/contents.rst2
-rw-r--r--tests/roots/test-ext-viewcode/objects.rst2
-rw-r--r--tests/test_api_translator.py3
-rw-r--r--tests/test_autodoc.py12
-rw-r--r--tests/test_build.py16
-rw-r--r--tests/test_build_gettext.py5
-rw-r--r--tests/test_build_html.py3
-rw-r--r--tests/test_domain_cpp.py35
12 files changed, 75 insertions, 30 deletions
diff --git a/Makefile b/Makefile
index 0e4a9ade..19318d12 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,22 @@ DONT_CHECK = -i build -i dist -i sphinx/style/jquery.js \
-i sphinx/pycode/pgen2 -i sphinx/util/smartypants.py \
-i .ropeproject -i doc/_build -i tests/path.py \
-i tests/coverage.py -i env -i utils/convert.py \
- -i sphinx/search/ja.py \
+ -i sphinx/search/da.py \
+ -i sphinx/search/de.py \
+ -i sphinx/search/en.py \
+ -i sphinx/search/es.py \
+ -i sphinx/search/fi.py \
+ -i sphinx/search/fr.py \
+ -i sphinx/search/hu.py \
+ -i sphinx/search/it.py \
+ -i sphinx/search/ja.py \
+ -i sphinx/search/nl.py \
+ -i sphinx/search/no.py \
+ -i sphinx/search/pt.py \
+ -i sphinx/search/ro.py \
+ -i sphinx/search/ru.py \
+ -i sphinx/search/sv.py \
+ -i sphinx/search/tr.py \
-i utils/reindent3.py -i utils/check_sources3.py -i .tox
all: clean-pyc clean-backupfiles check test
diff --git a/doc/domains.rst b/doc/domains.rst
index 4bfc91ec..15f8c7a3 100644
--- a/doc/domains.rst
+++ b/doc/domains.rst
@@ -526,7 +526,7 @@ The following directives are available. All declarations can start with a visibi
.. rst:directive:: .. cpp:class:: class speicifer
Describe a class/struct, possibly with specification of inheritance, e.g.,::
-
+
.. cpp:class:: SomeName::SomeClass : public MyBase, MyOtherBase
.. rst:directive:: .. cpp:function:: (member-)function prototype
diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst
index d0d49286..a5e5cda0 100644
--- a/doc/extdev/appapi.rst
+++ b/doc/extdev/appapi.rst
@@ -83,7 +83,7 @@ package.
Register an event called *name*. This is needed to be able to emit it.
.. method:: Sphinx.set_translator(name, translator_class)
-
+
Register or override a Docutils translator class. This is used to register
a custom output translator or to replace a builtin translator.
This allows extensions to use custom translator and define custom
diff --git a/sphinx/writers/texinfo.py b/sphinx/writers/texinfo.py
index 93d4d6aa..f0e4894b 100644
--- a/sphinx/writers/texinfo.py
+++ b/sphinx/writers/texinfo.py
@@ -1103,14 +1103,16 @@ class TexinfoTranslator(nodes.NodeVisitor):
def visit_caption(self, node):
if (isinstance(node.parent, nodes.figure) or
- (isinstance(node.parent, nodes.container) and node.parent.get('literal_block'))):
+ (isinstance(node.parent, nodes.container) and
+ node.parent.get('literal_block'))):
self.body.append('\n@caption{')
else:
self.builder.warn('caption not inside a figure.',
(self.curfilestack[-1], node.line))
def depart_caption(self, node):
if (isinstance(node.parent, nodes.figure) or
- (isinstance(node.parent, nodes.container) and node.parent.get('literal_block'))):
+ (isinstance(node.parent, nodes.container) and
+ node.parent.get('literal_block'))):
self.body.append('}\n')
def visit_image(self, node):
diff --git a/tests/roots/test-autosummary/contents.rst b/tests/roots/test-autosummary/contents.rst
index cd4b7c5e..0355c95b 100644
--- a/tests/roots/test-autosummary/contents.rst
+++ b/tests/roots/test-autosummary/contents.rst
@@ -2,6 +2,6 @@
.. autosummary::
:nosignatures:
:toctree:
-
+
dummy_module
sphinx
diff --git a/tests/roots/test-ext-viewcode/objects.rst b/tests/roots/test-ext-viewcode/objects.rst
index 8d304bec..fcea2165 100644
--- a/tests/roots/test-ext-viewcode/objects.rst
+++ b/tests/roots/test-ext-viewcode/objects.rst
@@ -46,7 +46,7 @@ Referring to :func:`nothing <>`.
.. object:: long(parameter, \
list)
- another one
+ another one
.. class:: TimeInt
diff --git a/tests/test_api_translator.py b/tests/test_api_translator.py
index e0ba5e0f..4dd70a2c 100644
--- a/tests/test_api_translator.py
+++ b/tests/test_api_translator.py
@@ -58,7 +58,8 @@ def test_html_with_set_translator_for_html_(app, status, warning):
@with_app('html', testroot='api-set-translator',
confoverrides={'html_translator_class': 'ext.ExtHTMLTranslator'})
-def test_html_with_set_translator_for_html_and_html_translator_class(app, status, warning):
+def test_html_with_set_translator_for_html_and_html_translator_class(
+ app, status, warning):
# use set_translator() and html_translator_class.
# set_translator() is given priority over html_translator_clas.
translator_class = app.builder.translator_class
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index f4ae0c08..10921b65 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -434,21 +434,25 @@ def test_docstring_property_processing():
return results, docstrings
directive.env.config.autodoc_docstring_signature = False
- results, docstrings = genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop1')
+ results, docstrings = \
+ genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop1')
assert '.. py:attribute:: DocstringSig.prop1' in results
assert 'First line of docstring' in docstrings
assert 'DocstringSig.prop1(self)' in docstrings
- results, docstrings = genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop2')
+ results, docstrings = \
+ genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop2')
assert '.. py:attribute:: DocstringSig.prop2' in results
assert 'First line of docstring' in docstrings
assert 'Second line of docstring' in docstrings
directive.env.config.autodoc_docstring_signature = True
- results, docstrings = genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop1')
+ results, docstrings = \
+ genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop1')
assert '.. py:attribute:: DocstringSig.prop1' in results
assert 'First line of docstring' in docstrings
assert 'DocstringSig.prop1(self)' not in docstrings
- results, docstrings = genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop2')
+ results, docstrings = \
+ genarate_docstring('attribute', 'test_autodoc.DocstringSig.prop2')
assert '.. py:attribute:: DocstringSig.prop2' in results
assert 'First line of docstring' in docstrings
assert 'Second line of docstring' in docstrings
diff --git a/tests/test_build.py b/tests/test_build.py
index fe38cfaf..117bb84c 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -76,13 +76,21 @@ def test_build_all():
def test_circular_toctree(app, status, warning):
app.builder.build_all()
warnings = warning.getvalue()
- assert 'circular toctree references detected, ignoring: sub <- contents <- sub' in warnings
- assert 'circular toctree references detected, ignoring: contents <- sub <- contents' in warnings
+ assert (
+ 'circular toctree references detected, ignoring: '
+ 'sub <- contents <- sub') in warnings
+ assert (
+ 'circular toctree references detected, ignoring: '
+ 'contents <- sub <- contents') in warnings
@with_app(buildername='text', testroot='numbered-circular')
def test_numbered_circular_toctree(app, status, warning):
app.builder.build_all()
warnings = warning.getvalue()
- assert 'circular toctree references detected, ignoring: sub <- contents <- sub' in warnings
- assert 'circular toctree references detected, ignoring: contents <- sub <- contents' in warnings
+ assert (
+ 'circular toctree references detected, ignoring: '
+ 'sub <- contents <- sub') in warnings
+ assert (
+ 'circular toctree references detected, ignoring: '
+ 'contents <- sub <- contents') in warnings
diff --git a/tests/test_build_gettext.py b/tests/test_build_gettext.py
index 1de1306e..677f3505 100644
--- a/tests/test_build_gettext.py
+++ b/tests/test_build_gettext.py
@@ -66,8 +66,9 @@ def test_all(app, status, warning):
print(stderr)
assert False, 'msgfmt exited with return code %s' % \
p.returncode
- yield assert_true, (app.outdir / 'en' / 'LC_MESSAGES' / 'test_root.mo').isfile(), \
- 'msgfmt failed'
+ yield (assert_true,
+ (app.outdir / 'en' / 'LC_MESSAGES' / 'test_root.mo').isfile(),
+ 'msgfmt failed')
finally:
os.chdir(cwd)
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index baf3b6a6..65fdc9fc 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -141,7 +141,8 @@ HTML_XPATH = {
(".//a[@href='http://www.python.org/dev/peps/pep-0008']"
"[@class='pep reference external']/strong", 'PEP 8'),
(".//a[@href='http://www.python.org/dev/peps/pep-0008']"
- "[@class='pep reference external']/strong", 'Python Enhancement Proposal #8'),
+ "[@class='pep reference external']/strong",
+ 'Python Enhancement Proposal #8'),
(".//a[@href='http://tools.ietf.org/html/rfc1.html']"
"[@class='rfc reference external']/strong", 'RFC 1'),
(".//a[@href='http://tools.ietf.org/html/rfc1.html']"
diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py
index 0b4219a5..5b839fad 100644
--- a/tests/test_domain_cpp.py
+++ b/tests/test_domain_cpp.py
@@ -27,7 +27,8 @@ def parse(name, string):
def check(name, input, output=None):
# first a simple check of the AST
- if output == None: output = input
+ if output is None:
+ output = input
ast = parse(name, input)
res = text_type(ast)
if res != output:
@@ -36,7 +37,8 @@ def check(name, input, output=None):
print("Expected: ", output)
raise DefinitionError("")
ast.describe_signature([], 'lastIsName', None)
- ast.prefixedName = ast.name # otherwise the get_id fails, it would be set in handle_signarue
+ ast.prefixedName = ast.name # otherwise the get_id fails, it would be set
+ # in handle_signarue
ast.get_id()
#print ".. %s:: %s" % (name, input)
@@ -49,7 +51,7 @@ def test_type_definitions():
check("type", "bool *volatile const b")
check("type", "bool *volatile const *b")
check("type", "bool &b")
- check("type", "bool b[]")
+ check("type", "bool b[]")
check("type", "std::pair<int, int> coord")
check("type", "long long int foo")
check("type", 'std::vector<std::pair<std::string, long long>> module::blah')
@@ -57,12 +59,20 @@ def test_type_definitions():
check("type", "std::function<R(A1, A2, A3)> F")
check("type", "std::function<R(A1, A2, A3, As...)> F")
check("type", "MyContainer::const_iterator")
- check("type", "public MyContainer::const_iterator", "MyContainer::const_iterator")
-
- check('member', ' const std::string & name = 42', 'const std::string &name = 42')
+ check("type",
+ "public MyContainer::const_iterator",
+ "MyContainer::const_iterator")
+
+ check('member',
+ ' const std::string & name = 42',
+ 'const std::string &name = 42')
check('member', ' const std::string & name', 'const std::string &name')
- check('member', ' const std::string & name [ n ]', 'const std::string &name[n]')
- check('member', 'const std::vector< unsigned int, long> &name', 'const std::vector<unsigned int, long> &name')
+ check('member',
+ ' const std::string & name [ n ]',
+ 'const std::string &name[n]')
+ check('member',
+ 'const std::vector< unsigned int, long> &name',
+ 'const std::vector<unsigned int, long> &name')
check('member', 'module::myclass foo[n]')
check('function', 'operator bool() const')
@@ -76,8 +86,10 @@ def test_type_definitions():
check('function', 'int foo(const unsigned int j)')
check('function', 'int foo(const int *const ptr)')
check('function', 'module::myclass::operator std::vector<std::string>()')
- check('function', 'void operator()(const boost::array<VertexID, 2> &v) const')
- check('function', 'void operator()(const boost::array<VertexID, 2, "foo, bar"> &v) const')
+ check('function',
+ 'void operator()(const boost::array<VertexID, 2> &v) const')
+ check('function',
+ 'void operator()(const boost::array<VertexID, 2, "foo, bar"> &v) const')
check('function', 'MyClass::MyClass(MyClass::MyClass&&)')
check('function', 'constexpr int get_value()')
check('function', 'static constexpr int get_value()')
@@ -101,7 +113,8 @@ def test_type_definitions():
x = 'std::vector<std::pair<std::string, int>> &module::test(register ' \
'foo, bar[n], std::string baz = "foobar, blah, bleh") const = 0'
check('function', x)
- check('function', 'int foo(Foo f = Foo(double(), std::make_pair(int(2), double(3.4))))')
+ check('function',
+ 'int foo(Foo f = Foo(double(), std::make_pair(int(2), double(3.4))))')
check('function', 'int foo(A a = x(a))')
raises(DefinitionError, parse, 'function', 'int foo(B b=x(a)')
raises(DefinitionError, parse, 'function', 'int foo)C c=x(a))')