You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f9dab5d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(i18n): fail the coverage gate on a floors file it can't read
load_floors() returned {} for a file that existed but didn't parse, so a
merge-conflicted translation_floors.json switched the gate off, and
--update-floors then rewrote every floor from that day's coverage. A
refuting review reproduced both: zh-rCN went from 76.5 to 70.0 with the gate
green, and a floor stored as a string was dropped the same way. A missing
file still means no floors yet. A present but unreadable one, a missing
"floors" object, or a non-numeric floor (booleans included) raises
FloorsFileError, which main() counts as an error, and write_floors() leaves
the file alone.
--update-floors skipped the floor check and printed success at any
coverage. It now checks against the floors it found first, so a locale below
its floor fails either way. The gate's error text told people to lower a
floor while the file said never to. Both now say a lower floor is a hand
edit explained in the commit.
Tests: test_floors_round_trip_and_a_broken_file_is_not_fatal pinned the
fail-open behaviour. It's replaced by ..._fails_closed, which asserts the
opposite for five broken shapes. New tests drive main() over a throwaway
res tree: below-floor --update-floors fails and keeps the floor, a passed
floor is raised (positive control), and an unreadable file fails the check
and isn't rewritten. Five mutants of the fix are each killed by name.
Copy file name to clipboardExpand all lines: scripts/translation_floors.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
{
2
-
"description": "Minimum translated-string coverage per locale, in percent. check_translations.py fails when a shipped locale drops below its floor. Raise a floor with --update-floors; never lower one by hand.",
2
+
"description": "Minimum translated-string coverage per locale, in percent. check_translations.py fails when a shipped locale drops below its floor. --update-floors only raises a floor. Lowering one is a hand edit, made on purpose and explained in the commit message.",
0 commit comments