Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Sep 27, 2022
1 parent 6b9d420 commit b0fc047
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sphinx_toolbox/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def visit_asset_node(translator: HTMLTranslator, node: AssetNode) -> None:

source_file = PathPlus(translator.builder.confdir) / node["source_file"]

if source_file not in translator._asset_node_seen_files and source_file.is_file(): # type: ignore
if source_file not in translator._asset_node_seen_files and source_file.is_file(): # type: ignore[attr-defined]
# Avoid unnecessary copies of potentially large files.
translator._asset_node_seen_files.append(source_file) # type: ignore[attr-defined]
shutil.copy2(source_file, assets_out_dir)
Expand Down
2 changes: 1 addition & 1 deletion sphinx_toolbox/more_autodoc/autoprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@

if sys.version_info < (3, 8): # pragma: no cover (>=py38)
# 3rd party
from typing_extensions import _ProtocolMeta
from typing_extensions import _ProtocolMeta # type: ignore[attr-defined]
else: # pragma: no cover (<py38)
# stdlib
from typing import _ProtocolMeta
Expand Down
3 changes: 1 addition & 2 deletions sphinx_toolbox/more_autodoc/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,7 @@ def add_content(self, more_content: Optional[StringList], no_docstring: bool = F
"""

if not self._datadescriptor:
# if it's not a data descriptor, its docstring is very probably the
# wrong thing to display
# if it's not a data descriptor, its docstring is very probably the wrong thing to display
no_docstring = True

_documenter_add_content(self, more_content, no_docstring)
Expand Down
2 changes: 1 addition & 1 deletion sphinx_toolbox/more_autosummary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class PatchedAutosummary(Autosummary):
Added support for customising the column type with the :confval:`autosummary_col_type` option.
"""

def import_by_name(self, name: str, prefixes: List[str]) -> Tuple[str, Any, Any, str]:
def import_by_name(self, name: str, prefixes: List[Optional[str]]) -> Tuple[str, Any, Any, str]:
"""
Import the object with the give name.
Expand Down
8 changes: 4 additions & 4 deletions sphinx_toolbox/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def add_enumerable_node(
self.registry.add_enumerable_node(
node,
figtype,
title_getter, # type: ignore[arg-type]
title_getter,
override=override,
)
self.add_node(node, override=override, **kwargs)
Expand Down Expand Up @@ -378,8 +378,8 @@ def add_object_type(
directivename,
rolename,
indextemplate,
parse_node, # type: ignore[arg-type]
ref_nodeclass, # type: ignore[arg-type]
parse_node,
ref_nodeclass,
objname,
doc_field_types,
override=override,
Expand All @@ -403,7 +403,7 @@ def add_crossref_type(
directivename,
rolename,
indextemplate,
ref_nodeclass, # type: ignore[arg-type]
ref_nodeclass,
objname,
override=override,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import shutil
import sys
import types
from typing import Iterator, List, Optional, Tuple
from typing import Iterator, Optional, Tuple

# 3rd party
import docutils.nodes
Expand Down

0 comments on commit b0fc047

Please sign in to comment.