|
From: <mi...@us...> - 2022-03-04 15:55:16
|
Revision: 9023
http://sourceforge.net/p/docutils/code/9023
Author: milde
Date: 2022-03-04 15:55:13 +0000 (Fri, 04 Mar 2022)
Log Message:
-----------
Fix multiple spaces after keyword
flake8 rule E271
Modified Paths:
--------------
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/docutils/transforms/references.py
trunk/docutils/docutils/utils/error_reporting.py
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/nodes.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -1384,7 +1384,7 @@
prefix = id + '-'
else:
prefix = id_prefix + auto_id_prefix
- if prefix.endswith('%'):
+ if prefix.endswith('%'):
prefix = '%s%s-' % (prefix[:-1],
suggested_prefix
or make_id(node.tagname))
@@ -2019,8 +2019,8 @@
Raise an exception unless overridden.
"""
- if (self.document.settings.strict_visitor
- or node.__class__.__name__ not in self.optional):
+ if (self.document.settings.strict_visitor
+ or node.__class__.__name__ not in self.optional):
raise NotImplementedError(
'%s visiting unknown node type: %s'
% (self.__class__, node.__class__.__name__))
@@ -2031,8 +2031,8 @@
Raise exception unless overridden.
"""
- if (self.document.settings.strict_visitor
- or node.__class__.__name__ not in self.optional):
+ if (self.document.settings.strict_visitor
+ or node.__class__.__name__ not in self.optional):
raise NotImplementedError(
'%s departing unknown node type: %s'
% (self.__class__, node.__class__.__name__))
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/parsers/rst/states.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -851,7 +851,7 @@
node_list = [reference]
if rawsource[-2:] == '__':
- if target and (aliastype == 'name'):
+ if target and (aliastype == 'name'):
reference['refname'] = alias
self.document.note_refname(reference)
# self.document.note_indirect_target(target) # required?
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/transforms/references.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -696,15 +696,15 @@
parent = ref.parent
index = parent.index(ref)
- if ('ltrim' in subdef.attributes
- or 'trim' in subdef.attributes):
+ if ('ltrim' in subdef.attributes
+ or 'trim' in subdef.attributes):
if index > 0 and isinstance(parent[index - 1],
nodes.Text):
parent[index - 1] = parent[index - 1].rstrip()
- if ('rtrim' in subdef.attributes
- or 'trim' in subdef.attributes):
- if (len(parent) > index + 1
- and isinstance(parent[index + 1], nodes.Text)):
+ if ('rtrim' in subdef.attributes
+ or 'trim' in subdef.attributes):
+ if (len(parent) > index + 1
+ and isinstance(parent[index + 1], nodes.Text)):
parent[index + 1] = parent[index + 1].lstrip()
subdef_copy = subdef.deepcopy()
try:
Modified: trunk/docutils/docutils/utils/error_reporting.py
===================================================================
--- trunk/docutils/docutils/utils/error_reporting.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/utils/error_reporting.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -135,7 +135,7 @@
return u
except UnicodeError as error: # catch ..Encode.. and ..Decode.. errors
if isinstance(self.data, EnvironmentError):
- return "[Errno %s] %s: '%s'" % (
+ return "[Errno %s] %s: '%s'" % (
self.data.errno,
SafeString(self.data.strerror, self.encoding,
self.decoding_errors),
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -1240,7 +1240,7 @@
math2html.DocumentParameters.displaymode = (math_env != '')
math_code = math2html.math2html(math_code)
elif self.math_output == 'mathml':
- if 'XHTML 1' in self.doctype:
+ if 'XHTML 1' in self.doctype:
self.doctype = self.doctype_mathml
self.content_type = self.content_type_mathml
converter = ' '.join(self.math_output_options).lower()
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/tox.ini 2022-03-04 15:55:13 UTC (rev 9023)
@@ -38,7 +38,6 @@
# whitespace around the operators with the lowest priority(ies).
# Use your own judgment; …"
- E271, # multiple spaces after keyword
E301, # expected 1 blank line, found 0
E302, # expected 2 blank lines, found 1
E303, # too many blank lines (N)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|