mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Enable E116 (Unexpected indentation (comment))
This commit is contained in:
parent
f0fa8a66f9
commit
85e32e3b73
@ -295,6 +295,7 @@ select = [
|
||||
"E113", # Unexpected indentation
|
||||
"E114", # Indentation is not a multiple of {indent_size} (comment)
|
||||
"E115", # Expected an indented block (comment)
|
||||
"E116", # Unexpected indentation (comment)
|
||||
]
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
|
@ -102,8 +102,7 @@ class NavPoint(NamedTuple):
|
||||
playorder: int
|
||||
text: str
|
||||
refuri: str
|
||||
children: list[Any] # mypy does not support recursive types
|
||||
# https://github.com/python/mypy/issues/7069
|
||||
children: list[NavPoint]
|
||||
|
||||
|
||||
def sphinx_smarty_pants(t: str, language: str = 'en') -> str:
|
||||
|
@ -29,8 +29,7 @@ logger = logging.getLogger(__name__)
|
||||
class NavPoint(NamedTuple):
|
||||
text: str
|
||||
refuri: str
|
||||
children: list[Any] # mypy does not support recursive types
|
||||
# https://github.com/python/mypy/issues/7069
|
||||
children: list[NavPoint]
|
||||
|
||||
|
||||
# writing modes
|
||||
|
@ -456,10 +456,12 @@ class SphinxRole:
|
||||
text: str #: The interpreted text content.
|
||||
lineno: int #: The line number where the interpreted text begins.
|
||||
inliner: Inliner #: The ``docutils.parsers.rst.states.Inliner`` object.
|
||||
options: dict #: A dictionary of directive options for customization
|
||||
#: A dictionary of directive options for customisation
|
||||
#: (from the "role" directive).
|
||||
content: Sequence[str] #: A list of strings, the directive content for customization
|
||||
options: dict[str, Any]
|
||||
#: A list of strings, the directive content for customisation
|
||||
#: (from the "role" directive).
|
||||
content: Sequence[str]
|
||||
|
||||
def __call__(self, name: str, rawtext: str, text: str, lineno: int,
|
||||
inliner: Inliner, options: dict | None = None, content: Sequence[str] = (),
|
||||
|
@ -1500,8 +1500,9 @@ class LaTeXTranslator(SphinxTranslator):
|
||||
length = self.latex_image_length(node['width'])
|
||||
elif isinstance(node[0], nodes.image) and 'width' in node[0]:
|
||||
length = self.latex_image_length(node[0]['width'])
|
||||
self.body.append(BLANKLINE) # Insert a blank line to prevent infinite loop
|
||||
# Insert a blank line to prevent an infinite loop
|
||||
# https://github.com/sphinx-doc/sphinx/issues/7059
|
||||
self.body.append(BLANKLINE)
|
||||
self.body.append(r'\begin{wrapfigure}{%s}{%s}' %
|
||||
('r' if node['align'] == 'right' else 'l', length or '0pt') + CR)
|
||||
self.body.append(r'\centering')
|
||||
|
Loading…
Reference in New Issue
Block a user