Name only the unresolved citation name, with the rule

This commit is contained in:
2026-09-25 00:35:04 +02:00
parent e0eb78bfd6
commit 1c05fbc5da
+2 -1
View File
@@ -21,4 +21,5 @@ class Citations(unittest.TestCase):
self.assertEqual([f"{path}: {stray}" for path, text in texts for stray in STRAY.findall(text)], [], 'spell a citation `CLAUDE.md` → "Vocabulary"')
cited = [(path, NAME.findall(run)) for path, text in texts for run in CITATION.findall(text)]
self.assertTrue(cited)
self.assertEqual([f"{path}: {names}" for path, names in cited if names[0] not in headings or set(names[1:]) - leads], [])
unresolved = [(path, name) for path, names in cited for name in [n for n in names[:1] if n not in headings] + [n for n in names[1:] if n not in leads]]
self.assertEqual([f"{path}: {name}" for path, name in unresolved], [], "the first name is a heading of CLAUDE.md, each later one a heading or a bold lead")