Skip to content

Commit e0dfae2

Browse files
authored
Only use code bytes for wiki_tu percentages (#1429)
1 parent 10acd60 commit e0dfae2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/wiki_tu.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ def friendly_size(key: str) -> str:
9696
# Link to source file
9797
file_link = f"[`{file}`](../blob/master/src/{file}.c)"
9898

99+
matched_code = float(unit["matched_code"])
100+
total_code = float(unit["total_code"])
101+
code_percent = (matched_code / total_code if total_code else 0) * 100
99102
matched = f"{friendly_size('matched_code')}"
100103
total = f"{friendly_size('total_code')}"
101-
percent = f"`{humanfriendly.round_number(unit['fuzzy_match_percent'] or 0)}%`"
104+
percent = f"`{humanfriendly.round_number(code_percent)}%`"
102105
linked = ":heavy_check_mark:" if unit["complete"] else ":x:"
103106

104107
if assignee := assignees.get(file):

0 commit comments

Comments
 (0)