Leave zero-byte languages out of the stats chart

This commit is contained in:
Mark Eaton committed 2026-11-11 19:52:08 -05:00
1 parent 73d2a83250
commit 9f76bf6c41
2 files changed
+14 -1

No files matched your search

+3 -1
View File
@@ -200,7 +200,9 @@ def generate_markdown(totals: dict[str, int]) -> str:
if total_bytes == 0:
return ""
pairs = sorted(totals.items(), key=lambda x: x[1], reverse=True)
# Languages whose bytes were all excluded would otherwise show as 0.0%
nonzero = [(lang, nbytes) for lang, nbytes in totals.items() if nbytes > 0]
pairs = sorted(nonzero, key=lambda x: x[1], reverse=True)
lang_lines = []
for lang, nbytes in pairs: