File tree Expand file tree Collapse file tree
utils/external_project_parsers/parsers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def _make_record(
4444 source_id = source_id ,
4545 title = title ,
4646 hyperlink = f"{ base } /{ source_id } .html" ,
47- summary = "" ,
47+ summary = "Test summary " ,
4848 headings = headings or [],
4949 raw_markdown_path = f"cheatsheets/{ source_id } .md" ,
5050 category_hints = category_hints or [],
Original file line number Diff line number Diff line change @@ -208,6 +208,15 @@ def __post_init__(self) -> None:
208208 f"CheatsheetRecord.{ fname } must be a non-empty string, "
209209 f"got { value !r} "
210210 )
211+ for fname in ("headings" , "category_hints" ):
212+ value = getattr (self , fname )
213+ if not isinstance (value , list ) or not all (
214+ isinstance (item , str ) for item in value
215+ ):
216+ raise ValueError (
217+ f"CheatsheetRecord.{ fname } must be a list of strings, "
218+ f"got { value !r} "
219+ )
211220
212221
213222# ---------------------------------------------------------------------------
@@ -368,6 +377,7 @@ def _validate_labels(labels) -> List[str]:
368377
369378 Returns an empty list if nothing valid remains; the caller should
370379 fall back to deterministic categorisation in that case.
380+ UNCATEGORIZED is stripped if other real labels are present.
371381 """
372382 if not isinstance (labels , list ):
373383 return []
@@ -378,4 +388,5 @@ def _validate_labels(labels) -> List[str]:
378388 if lbl not in seen :
379389 deduped .append (lbl )
380390 seen .add (lbl )
381- return deduped
391+ real = [lbl for lbl in deduped if lbl != UNCATEGORIZED ]
392+ return real if real else deduped
You can’t perform that action at this time.
0 commit comments