Skip to content

fix: singularize databases to database instead of databasis - #4191

Merged
bpamiri merged 3 commits into
developfrom
peter/singularize-databases
Oct 5, 2026
Merged

bpamiri merged 3 commits into
developfrom
peter/singularize-databases

Conversation

@bpamiri

@bpamiri bpamiri commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #4189

This changes behaviour: singularize("databases") was databasis.

Summary

The singularize -ses rule for basis (…|(b)a|…)ses$) also matched the end of databases, so singularize("databases") returned databasis on every engine.

This PR adds (database)s$ → \1 just before the -ses rules, the same dedicated rule Rails uses. It only matches words ending in databases.

Compatibility. An app that relied on databasis, for example a model or table named after it, needs to rename it. That's unlikely; the changelog fragment says so.

Conflict. This PR and #4188 edit the same singularize rule line. #4188 merged first; develop is merged in here, and the rule line now differs from develop only by the added (database)s$ rule.

Upgrade notes

Test plan

  • New spec. vendor/wheels/tests/specs/global/SingularizeDatabasesSpec.cfc checks databases, Databases and userDatabases. It also pins the current output for bases (→ basis), cases, phases, purchases and vases, and pluralize for the singular forms.
  • RED on develop: Lucee 7 and BoxLang each fail only the databases spec (databasis); the other two specs pass.
  • GREEN: 3/3 on Lucee 7 and BoxLang.
  • global directory (pass / fail / error):
Engine Result
Lucee 7 308 / 0 / 0
Lucee 6 308 / 0 / 0
Adobe ColdFusion 2023 307 / 0 / 0
Adobe ColdFusion 2025 307 / 0 / 0
BoxLang 308 / 0 / 0
RustCFML v0.693.0 307 / 0 / 0
  • Full suite (tools/test-local.sh, Lucee 7 + SQLite): 6525 passed.

  • After merging develop (for 4.2): global specs (SQLite) 313 / 0 / 0 on Lucee 7, Lucee 6 and BoxLang, 312 / 0 / 0 on Adobe 2023, Adobe 2025 and RustCFML v0.693.0; full core suite, Lucee 7 + SQLite: 6703 passed (including the internal repo-path specs); guides build passes.

🤖 Generated with Claude Code

The -ses rule for basis/bases also matched the end of "databases". A dedicated (database)s$ rule,
as Rails has, now runs first. bases still singularizes to basis; other -ases words are unchanged.

Fixes #4189

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
@bpamiri bpamiri added this to the v4.3.0 milestone Oct 3, 2026
@bpamiri

bpamiri commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

rev1-r1 review @ 6f4e108 (draft, 4.3): APPROVE on code; merge gated on compat-matrix run 37114969130 and on 4.2.0 shipping.

  • (database)s$ → \1 goes ahead of the -ses rules, so databases is singularized before the (b)a…ses$ alternative can turn its "…bases" ending into databasis. The rule loop takes the first matching rule, so placement is what matters.
  • The pattern is anchored only at the end, so compounds (mydatabases, testDatabases via the camelCase tail split) singularize the same way. No other word is affected: bases → basis is unchanged (whether that's the right reading of bases is a separate, pre-existing question), and the spec pins cases/phases/purchases/vases as before.
  • It conflicts textually with fix: stop singularize() turning psychoanalyses into psychoanalyasis #4188 (the same rule line). Whichever merges second needs a rebase that keeps both changes: fix: stop singularize() turning psychoanalyses into psychoanalyasis #4188's \1sis and this PR's new (database)s$ rule.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Wheels Test Results

218 119 tests   213 893 ✅  1h 12m 10s ⏱️
 16 768 suites    4 226 💤
     32 files          0 ❌

Results for commit 078584b.

♻️ This comment has been updated with latest results.

bpamiri and others added 2 commits October 4, 2026 22:36
…databases

Signed-off-by: Peter Amiri <peter@alurium.com>

# Conflicts:
#	vendor/wheels/global/strings.cfm
…de guide

Moves the fragment to `changed`, since singularize("databases") output
changes, and extends the existing "singularize() corrects some -ses
words" entry in the 4.1 to 4.2 upgrade guide rather than adding a
second one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
@bpamiri bpamiri modified the milestones: v4.3.0, v4.2.0 Oct 5, 2026
@bpamiri
bpamiri marked this pull request as ready for review October 5, 2026 05:43
@bpamiri

bpamiri commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Final: APPROVE @ 078584b (lifted into 4.2; matrix 37269045190, all 32 legs read)

Delta since my approval at 6f4e108

  • The strings.cfm conflict resolution is correct. The merged singularize rule list is exactly develop's line, including fix: stop singularize() turning psychoanalyses into psychoanalyasis #4188's (analy|ba|…)ses$ rule, plus only (database)s$,\1,, placed before the -ses rules. The rule loop breaks on the first ReFindNoCase match, so databases no longer reaches the ba-ses branch, and \1 keeps the case (Databases → Database).
  • The spec and fragment content are unchanged; the fragment is retyped to changed.
  • fix: stop singularize() turning psychoanalyses into psychoanalyasis #4188's guide entry is extended accurately. Its unchanged-word list matches the spec's cases, and it adds the note about renaming anything named after databasis.

Matrix

No open findings.

@bpamiri
bpamiri merged commit 9091bc6 into develop Oct 5, 2026
72 checks passed
@bpamiri
bpamiri deleted the peter/singularize-databases branch October 5, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

singularize() returns "databasis" for "databases"

1 participant