Skip to content

Commit

Permalink
Enable automatic formatting for sphinx/domains/index.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Dec 31, 2024
1 parent 4da48f5 commit 8519590
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ preview = true
quote-style = "single"
exclude = [
"sphinx/builders/latex/constants.py",
"sphinx/domains/index.py",
"sphinx/domains/javascript.py",
"sphinx/domains/math.py",
"sphinx/domains/python/_annotations.py",
Expand Down
9 changes: 6 additions & 3 deletions sphinx/domains/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ def process_doc(self, env: BuildEnvironment, docname: str, document: Node) -> No
"""Process a document after it is read by the environment."""
entries = self.entries.setdefault(env.docname, [])
for node in list(document.findall(addnodes.index)):
node_entries = node['entries']
try:
for (entry_type, value, _target_id, _main, _category_key) in node['entries']:
for entry_type, value, _target_id, _main, _category_key in node_entries:
split_index_msg(entry_type, value)
except ValueError as exc:
logger.warning(str(exc), location=node)
node.parent.remove(node)
else:
for entry in node['entries']:
for entry in node_entries:
entries.append(entry)


Expand Down Expand Up @@ -88,7 +89,9 @@ def run(self) -> list[Node]:
indexnode['inline'] = False
self.set_source_info(indexnode)
for entry in arguments:
indexnode['entries'].extend(process_index_entry(entry, targetnode['ids'][0]))
indexnode['entries'].extend(
process_index_entry(entry, targetnode['ids'][0])
)
return [indexnode, targetnode]


Expand Down

0 comments on commit 8519590

Please sign in to comment.