-
-
Notifications
You must be signed in to change notification settings - Fork 943
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
infra: implement inactive locales content generation enhancement #2265
Conversation
The pipeline is failing to locales that were implemented poorly before. Look at: faker/src/locales/ar/date/weekday.ts Lines 1 to 13 in 8530a3e
We simply casted the type here. What should be the expected behaviour here? |
I'm not sure blanket sorting everything makes sense You lose inherent ordering like days of the week. And in many languages a naive sort based on Unicode character values doesn't reflect how strings are sorted. Plus it causes a lot of churn meaning git blame is less useful. |
IMO we should split these composite files into a folder and individual files. |
That doesn't really answer the question I had. Should the generation script be able to handle invalid locales or no? Since the |
How many invalid entries do we have? |
Additionally we may be losing useful information in the definitions by resorting. For example while implementing #1704 it turned out the first_name file actually had all the male names first, then all the female names. So it was easy to split them. If this script had already been run prior to that, there wouldn't have been any easy way to separate the female and male names. The number of files being touched here makes it unrealistic to manually review each one and see if any useful information is being discarded. |
That might be. But the thing is that we already request our contributors to sort te locale entries. Some examples:
We generally want this. Sure, we might lose some context but gain standardization in return.
Agreed. But sadly this always happends if we do major changes to the locale structure. What do you suggest? |
AFAIK there aren't any data in our locales that are supposed to contain any extra information by their order.
Is there a file left that would still support this or all of them already split?
The easiest way to review these is by reviewing the script and then resetting the locales to |
Also your comment @matthewmayer: #1823 (review)
I'm not saying that it is not allowed to change ones opinon, but you had this idea once as well^^ |
Honestly, thats super big brain. Never thought about this kind of review 👀 |
All that are currently fail in the CI. So 3 AFAICT. |
IMO 3 are easily fixable manually. |
I agree new entries should always be in alphabetical order unless they are something with a logical order like days of the week. I'm just concerned about subtly losing information if old entries are sorted alphabetically. |
ee486a4
to
ba53fb7
Compare
Blocked by #2293 |
ba53fb7
to
a42addb
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #2265 +/- ##
==========================================
- Coverage 99.59% 99.58% -0.01%
==========================================
Files 2823 2823
Lines 255517 255517
Branches 1106 1105 -1
==========================================
- Hits 254475 254458 -17
- Misses 1014 1031 +17
Partials 28 28 |
Description
This PR introduces a locale file normalization into the
generateLocales
script. This allows us to remove additional maintainace burdens by automatically checking (and fixing) for the following this in the same file:This PR also includes all to changes to all locale files which are affeected by the new rule. Honestly, I have no idea how you want to review this...
How to review
Please follow the steps @ST-DDT suggested in #2265 (comment):