Skip to content

feat: enforce strict BCP47 language tag validation#280

Merged
bfabio merged 1 commit intomainfrom
bcp47_strict
Mar 18, 2026
Merged

feat: enforce strict BCP47 language tag validation#280
bfabio merged 1 commit intomainfrom
bcp47_strict

Conversation

@bfabio
Copy link
Copy Markdown
Member

@bfabio bfabio commented Nov 8, 2025

No description provided.

go-playground/validator's bcp47_language_tag accepted 3-letter ISO 639-2
codes (ita, fra, deu) and POSIX underscore tags (en_GB, hr_HR), which are
not valid BCP47.

validators/bcp47.go is a local copy of go-playground/validator#1489 (not
yet merged) and should be removed once that lands.

Fix #47.
@bfabio bfabio marked this pull request as ready for review March 18, 2026 08:17
@bfabio bfabio changed the title Bcp47 strict feat: enforce strict BCP47 language tag validation Mar 18, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 0.98039% with 101 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.61%. Comparing base (069063c) to head (732128e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
validators/bcp47.go 0.00% 100 Missing ⚠️
validators/common.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #280      +/-   ##
==========================================
- Coverage   52.43%   47.61%   -4.83%     
==========================================
  Files          14       15       +1     
  Lines         967     1067     +100     
==========================================
+ Hits          507      508       +1     
- Misses        430      529      +99     
  Partials       30       30              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bfabio bfabio merged commit 915b968 into main Mar 18, 2026
5 of 7 checks passed
@bfabio bfabio deleted the bcp47_strict branch March 18, 2026 08:18
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