Skip to content

fix: correct @Dsuf array construction in 10 language modules#105

Merged
atoomic merged 2 commits into
cpan-authors:mainfrom
Koan-Bot:koan.atoomic/fix-dsuf-array-syntax
Apr 29, 2026
Merged

fix: correct @Dsuf array construction in 10 language modules#105
atoomic merged 2 commits into
cpan-authors:mainfrom
Koan-Bot:koan.atoomic/fix-dsuf-array-syntax

Conversation

@Koan-Bot
Copy link
Copy Markdown

@Koan-Bot Koan-Bot commented Apr 3, 2026

What

Fix Perl string-repetition bugs in @Dsuf arrays across 10 language modules, plus remove duplicate timezone entries.

Why

("η" x 31) creates a single string "ηηηηη..." — not a 31-element array. The correct syntax is ("η") x 31. This affects Greek, Swedish, Amharic, Tigrinya (3 variants). Brazilian and Chinese had arrays short by 1-2 elements. Czech and Russian never initialized @Dsuf at all.

While most of these modules have format_o overrides that don't use @Dsuf, the arrays are still wrong and would break if anyone adds a @Dsuf-based format_o or if test coverage is tightened (which this PR does).

Also removes duplicate ict and pht entries in Time::Zone (identical values, harmless but clearly unintended duplication from a prior merge).

Testing

  • Added @Dsuf size validation (>= 31) to lang-data.t
  • Full suite: 1256 tests pass

🤖 Generated with Claude Code


Quality Report

Changes: 12 files changed, 17 insertions(+), 15 deletions(-)

Code scan: clean

Tests: skipped

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Comment thread lib/Date/Language/Chinese.pm Outdated
our @AMPM = qw(上午 下午);

our @Dsuf = (qw(日 日 日 日 日 日 日 日 日 日)) x 3;
our @Dsuf = ("日") x 32;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not x31 here?

Comment thread lib/Date/Language/Czech.pm Outdated
our @DoWs = qw(Ne Po Út St Èt Pá So);

our @AMPM = qw(dop. odp.);
our @Dsuf = ('.') x 32;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question there, why using 32 and not 31?

Copy link
Copy Markdown
Collaborator

@atoomic atoomic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Koan-Bot rebase and reply to questions

Koan-Bot and others added 2 commits April 26, 2026 23:49
Several language modules had Perl string-repetition bugs where
`("x" x 31)` creates a single string of 31 repeated characters
instead of `("x") x 31` which creates an array of 31 elements.

Affected modules: Greek, Swedish, Amharic, Tigrinya, TigrinyaEritrean,
TigrinyaEthiopian. Also fixes short arrays in Brazilian (30→32) and
Chinese (30→32), and adds missing @Dsuf initialization in Czech and
Russian.

Removes duplicate ICT and PHT entries in Time::Zone.

Adds @Dsuf size validation to lang-data.t to prevent regression.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Portuguese also uses `x 32` but that's pre-existing code not part of this PR. I'll leave it alone — the reviewer only asked about changes in this PR.

Here's the summary:

- Changed `@Dsuf` from `x 32` to `x 31` in Chinese.pm, Czech.pm, and Russian.pm per reviewer feedback requesting consistency with the codebase convention (Hungarian, Finnish, Dutch, Romanian, Greek, Swedish, and most other modules all use 31 elements)
@Koan-Bot
Copy link
Copy Markdown
Author

Rebase with requested adjustments

Branch koan.atoomic/fix-dsuf-array-syntax was rebased onto main and review feedback was applied.

Changes applied

  • Portuguese also uses x 32 but that's pre-existing code not part of this PR. I'll leave it alone — the reviewer only asked about changes in this PR.
  • Here's the summary:
  • Changed @Dsuf from x 32 to x 31 in Chinese.pm, Czech.pm, and Russian.pm per reviewer feedback requesting consistency with the codebase convention (Hungarian, Finnish, Dutch, Romanian, Greek, Swedish, and most other modules all use 31 elements)

Stats

11 files changed, 15 insertions(+), 11 deletions(-)
Actions performed
  • Already-solved check: skipped (Claude call failed)
  • Rebased koan.atoomic/fix-dsuf-array-syntax onto upstream/main
  • Applied review feedback
  • Pre-push CI check: previous run passed
  • Force-pushed koan.atoomic/fix-dsuf-array-syntax to origin
  • CI check enqueued in ## CI (async)

CI status

CI will be checked asynchronously.


Automated by Kōan

@Koan-Bot Koan-Bot force-pushed the koan.atoomic/fix-dsuf-array-syntax branch from 789e7f8 to d664125 Compare April 27, 2026 05:51
@atoomic atoomic marked this pull request as ready for review April 29, 2026 09:35
@atoomic atoomic merged commit babb980 into cpan-authors:main Apr 29, 2026
22 checks passed
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@Koan-Bot Koan-Bot deleted the koan.atoomic/fix-dsuf-array-syntax branch April 29, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants