Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded type: ignore annotations #813

Merged
merged 3 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion breathe/directives/class_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from breathe.renderer.target import create_target_handler

from docutils.nodes import Node
from docutils.parsers.rst.directives import unchanged_required, unchanged, flag # type: ignore
from docutils.parsers.rst.directives import unchanged_required, unchanged, flag

from typing import Any, List

Expand Down
2 changes: 1 addition & 1 deletion breathe/directives/content_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from breathe.renderer.target import create_target_handler

from docutils.nodes import Node
from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore
from docutils.parsers.rst.directives import unchanged_required, flag

from typing import Any, List

Expand Down
2 changes: 1 addition & 1 deletion breathe/directives/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from breathe.renderer.sphinxrenderer import SphinxRenderer
from breathe.renderer.target import create_target_handler

from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore
from docutils.parsers.rst.directives import unchanged_required, flag


class _BaseFileDirective(BaseDirective):
Expand Down
2 changes: 1 addition & 1 deletion breathe/directives/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from breathe.renderer.target import create_target_handler

from docutils.nodes import Node
from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore
from docutils.parsers.rst.directives import unchanged_required, flag

from sphinx.domains import cpp

Expand Down
2 changes: 1 addition & 1 deletion breathe/directives/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from breathe.renderer.target import create_target_handler

from docutils.nodes import Node
from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore
from docutils.parsers.rst.directives import unchanged_required, flag

from typing import List

Expand Down
2 changes: 1 addition & 1 deletion breathe/directives/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from docutils.nodes import Node

from docutils.parsers.rst.directives import unchanged_required, flag # type: ignore
from docutils.parsers.rst.directives import unchanged_required, flag

from typing import Any, List

Expand Down
12 changes: 6 additions & 6 deletions breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ def render_declaration(self, node, declaration=None, description=None, **kwargs)
return nodes

def visit_doxygen(self, node) -> List[Node]:
nodelist = []
nodelist: List[Node] = []

# Process all the compound children
for n in node.get_compound():
Expand Down Expand Up @@ -1736,19 +1736,19 @@ def visit_verbatim(self, node) -> List[Node]:

return [rst_node]

def visit_inc(self, node: compoundsuper.incType) -> List[nodes.container]:
def visit_inc(self, node: compoundsuper.incType) -> List[Node]:
if not self.app.config.breathe_show_include:
return []

compound_link = [nodes.Text("", node.content_[0].getValue())]
compound_link: List[Node] = [nodes.Text("", node.content_[0].getValue())]
if node.get_refid():
compound_link = self.visit_docreftext(node)
if node.local == "yes":
text = [nodes.Text('#include "'), *compound_link, nodes.Text('"')]
else:
text = [nodes.Text("#include <"), *compound_link, nodes.Text(">")]

return [nodes.container("", nodes.emphasis("", *text))]
return [nodes.container("", nodes.emphasis("", "", *text))]

def visit_ref(self, node: compoundsuper.refType) -> List[Node]:
def get_node_info(file_data):
Expand Down Expand Up @@ -1862,7 +1862,7 @@ def visit_docvarlistentry(self, node) -> List[Node]:
return self.render_iterable(content)

def visit_docanchor(self, node) -> List[Node]:
return self.create_doxygen_target(node)
return list(self.create_doxygen_target(node))

def visit_docentry(self, node) -> List[Node]:
col = nodes.entry()
Expand Down Expand Up @@ -2196,7 +2196,7 @@ def visit_friendclass(self, node) -> List[Node]:
def visit_templateparam(
self, node: compound.paramTypeSub, *, insertDeclNameByParsing: bool = False
) -> List[Node]:
nodelist = []
nodelist: List[Node] = []

# Parameter type
if node.type_:
Expand Down