style: apply Black formatting for auto-tag CI

This commit is contained in:
star-nebula 2026-11-07 08:48:28 +08:00
parent 09e58d0294
commit 3460c47f83
2 changed files with 5 additions and 17 deletions

View file

@ -117,11 +117,7 @@ class AutoTagStep(BaseStep):
"""Keep the title-adjacent text and heading outline within a local model budget."""
if len(content) <= max_chars:
return content
headings = [
line.strip()
for line in content.splitlines()
if line.lstrip().startswith("#") and line.strip()
]
headings = [line.strip() for line in content.splitlines() if line.lstrip().startswith("#") and line.strip()]
heading_text = "\n".join(headings)
if len(heading_text) > max_chars // 3:
heading_text = heading_text[: max_chars // 3]
@ -158,11 +154,7 @@ class AutoTagStep(BaseStep):
candidates = [item[0] for item in page["items"]]
excerpt = self._document_excerpt(post.content, self.direct_excerpt_chars)
metadata_hint = {
key: metadata[key]
for key in ("name", "description", "kind")
if key in metadata
}
metadata_hint = {key: metadata[key] for key in ("name", "description", "kind") if key in metadata}
messages = [
SystemMsg(
name="system",
@ -232,9 +224,7 @@ class AutoTagStep(BaseStep):
line for line in post.content.splitlines() if not line.lstrip().startswith("#")
)
searchable = "\n".join(
value
for value in (str(metadata.get("description") or ""), body_without_headings)
if value
value for value in (str(metadata.get("description") or ""), body_without_headings) if value
)
evidence_key = self._evidence_key(evidence)
searchable_key = self._evidence_key(searchable)

View file

@ -121,12 +121,10 @@ async def test_windows_separator_paths_are_canonicalized(backend_cls):
"daily/2026-10-27/b.md",
}
assert {
link.target_path
for link in await graph.get_outlinks(r"daily\2026-10-27\a.md", scope=LinkScopeEnum.ALL)
link.target_path for link in await graph.get_outlinks(r"daily\2026-10-27\a.md", scope=LinkScopeEnum.ALL)
} == {"daily/2026-10-27/b.md"}
assert {
link.source_path
for link in await graph.get_inlinks(r"daily\2026-10-27\b.md", scope=LinkScopeEnum.ALL)
link.source_path for link in await graph.get_inlinks(r"daily\2026-10-27\b.md", scope=LinkScopeEnum.ALL)
} == {"daily/2026-10-27/a.md"}
assert await graph.get_outlinks(r"daily\2026-10-27\a.md", scope=LinkScopeEnum.VIRTUAL) == []