mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Apply refurb/ruff rule FURB171 (#11851)
This commit is contained in:
committed by
GitHub
parent
76cd0dbe3d
commit
6e6f975cb0
@@ -50,7 +50,7 @@ class MetadataCollector(EnvironmentCollector):
|
||||
md[node.__class__.__name__] = node.astext()
|
||||
|
||||
for name, value in md.items():
|
||||
if name in ('tocdepth',):
|
||||
if name == 'tocdepth':
|
||||
try:
|
||||
value = int(value)
|
||||
except ValueError:
|
||||
|
||||
@@ -330,7 +330,7 @@ def generate_autosummary_content(name: str, obj: Any, parent: Any,
|
||||
if doc.objtype in ('method', 'attribute', 'property'):
|
||||
ns['class'] = qualname.rsplit(".", 1)[0]
|
||||
|
||||
if doc.objtype in ('class',):
|
||||
if doc.objtype == 'class':
|
||||
shortname = qualname
|
||||
else:
|
||||
shortname = qualname.rsplit(".", 1)[-1]
|
||||
|
||||
Reference in New Issue
Block a user