Skip to content

chore(i18n): promote check-keys.py unused-key check from warn to fail - #337

Merged
krisarmstrong merged 1 commit into
mainfrom
chore/i18n-promote-unused-fail
May 27, 2026
Merged

chore(i18n): promote check-keys.py unused-key check from warn to fail#337
krisarmstrong merged 1 commit into
mainfrom
chore/i18n-promote-unused-fail

Conversation

@krisarmstrong

Copy link
Copy Markdown
Collaborator

Summary

All 3 products now hit 0 unused EN locale keys via the per-repo
dynamic-prefixes.txt allowlists (niac-go#732 + stem#335 +
seed#1216). Promoting the unused-key check from warn-only to fail
so future cruft gets caught at PR time.

How to fix a new "unused" failure

If a key shows up as unused but is genuinely consumed via a
dynamic lookup the static analyzer can't see, add a prefix entry
to scripts/i18n/dynamic-prefixes.txt with a one-line WHY
comment:

# foo.bar.* — Bar component renders via t(`foo:bar.${id}`).
foo:bar.

If a key is genuinely dead, delete it from EN+ES locale JSON.

Escape hatch

--ratchet downgrades the check back to warn for callers that
want to defer cleanup. The shared validator passes --ratchet
through, so CI invocations using ./scripts/i18n/validate.sh --ratchet still get the lenient behaviour.

Test plan

  • python3 scripts/i18n/check-keys.py strict — exits 0
  • CI: i18n Validation job

All 3 products now hit 0 unused EN locale keys via the per-repo
dynamic-prefixes.txt allowlists (niac-go#732 + stem#335 +
seed#1216). Promoting the unused-key check from warn-only to fail
so future cruft gets caught at PR time.

To allow a genuinely dynamic-lookup key that the static analyzer
can't see, add a prefix entry to scripts/i18n/dynamic-prefixes.txt
with a one-line WHY comment. --ratchet downgrades the check back
to warn for callers that want to defer cleanup (the validator
passes --ratchet through).
@krisarmstrong
krisarmstrong enabled auto-merge (squash) May 27, 2026 16:05
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions

Copy link
Copy Markdown
Contributor

License Compliance Report

All dependencies pass license compliance checks

Go Dependencies

  • Unknown: 31 package(s)
  • MIT: 26 package(s)
  • BSD-3-Clause: 16 package(s)
  • Apache-2.0: 11 package(s)
  • BSD-2-Clause: 1 package(s)

npm Dependencies

See full report in workflow artifacts

Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0
Forbidden: GPL, AGPL, SSPL (strong copyleft)

@krisarmstrong
krisarmstrong merged commit a58d429 into main May 27, 2026
25 checks passed
@krisarmstrong
krisarmstrong deleted the chore/i18n-promote-unused-fail branch May 27, 2026 16:08
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.

1 participant