fix: @Dsuf off-by-one drops ordinal suffix for day 31#139
Draft
Koan-Bot wants to merge 1 commit into
Draft
Conversation
20 language modules had @Dsuf with only 31 elements (indices 0-30). format_o accesses $dsuf->[$day] where $day is 1-31, so day 31 reads index 31 which was undef — producing "31" with no suffix and an uninitialized value warning. Visible in 8 modules without format_o overrides (Romanian, Amharic, Tigrinya, TigrinyaEritrean, TigrinyaEthiopian, Arabic, Occitan, Spanish). The remaining 12 modules had the same short array but were masked by custom format_o implementations. Fix: extend all @Dsuf arrays to 32 elements. Tighten the lang-data.t validation threshold from >= 31 to >= 32 and add a regression test exercising format_o on day 31 for every language. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix
format_o(%o) producing bare "31" instead of "31st" (orlanguage-equivalent suffix) on the 31st day of the month.
Why
20 language modules declared
@Dsufwith only 31 elements (indices0–30). Since
format_oaccesses$dsuf->[$day]where$dayis1–31, day 31 read index 31 →
undef, producing no suffix and anuninitialized valuewarning underuse warnings.8 modules were visibly affected (no custom
format_ooverride):Romanian, Amharic, Tigrinya, TigrinyaEritrean, TigrinyaEthiopian,
Arabic, Occitan, Spanish. The other 12 had the same short array but
were masked by custom
format_oimplementations.How
@Dsufarrays to 32 elements (indices 0–31)lang-data.tvalidation from>= 31to>= 32format_oon day 31 for every languageTesting
Full test suite passes (1523 tests across 39 files).
🤖 Generated with Claude Code
Quality Report
Changes: 21 files changed, 41 insertions(+), 24 deletions(-)
Code scan: clean
Tests: skipped
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline