-
-
Notifications
You must be signed in to change notification settings - Fork 276
update validate-tooling-data for eliminate case insensitive languages #1516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1516 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 396 396
Branches 106 106
=========================================
Hits 396 396 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hey @Vishv04, Can you tell me what change you made for this file 'validate-tooling-data.yml'. Is it necessary to change something there because the reason for failing this PR is changing this unauthorized file |
Hi @jagpreetrahi, I added a custom caseInsensitiveUnique rule in validate-tooling-data.yml to detect case-insensitive duplicates in the languages array—like treating "JavaScript" and "javascript" as the same. The logic checks if the input is an array, then builds two sets: one with original values and one with lowercase versions. If their sizes differ, it logs duplicates and throws a validation error. |
@jviotti can i get your support to help me reviewing this solution? |
I don't think there is any reason to add a new keyword here. Why not just use |
Thank you @benjagm @jviotti for your response on this PR.
Yes, using a pattern works, but it feels a bit like we're controlling user input, since users will naturally write "Javascript" instead of "javascript" (just my assumption, it might be wrong). I created the custom keyword to avoid forcing users to change how they enter data. Still, using a pattern could also be a workable option. |
I really suggest just using |
What kind of change does this PR introduce?
Feature - Adds case-insensitive unique validation for language entries
Issue Number:
Screenshots/videos:

Forcefully made mistakes in the name of language,
Validator finds the mistake,

If relevant, did you update the documentation?
Summary
This PR introduces case-insensitive unique validation for language entries in the tooling data to solve several existing problems:
My solution:
Implements a custom AJV keyword
caseInsensitiveUnique
that:Does this PR introduce a breaking change?
✅ Yes
Impact:
This PR enforces case-insensitive uniqueness for language entries. Any existing tooling data that includes language names with inconsistent casing—such as
"JavaScript"
and"javascript"
—will now fail validation. This change helps eliminate redundancy and confusion caused by duplicate entries with different letter cases.Who is affected:
Tool maintainers and contributors who have added language entries with varying casing.
Migration Path:
Update your
languages
arrays to ensure that each language appears only once in a consistent format, preferably matching the casing defined in the schema enum. For example: