Skip to content

Introduce international and national phone number formats#425

Merged
panilya merged 21 commits intodatafaker-net:mainfrom
panilya:phone-number-improvement
Oct 22, 2022
Merged

Introduce international and national phone number formats#425
panilya merged 21 commits intodatafaker-net:mainfrom
panilya:phone-number-improvement

Conversation

@panilya
Copy link
Copy Markdown
Collaborator

@panilya panilya commented Oct 6, 2022

Issue: #168

Locales with international and national formats:

  • en-US
  • en-GB
  • bg
  • by
  • ca
  • ca-CAT
  • cs
  • cs-CZ
  • da-DK
  • de
  • de-AT
  • de-CH
  • ee
  • en-AU
  • en-au-ocker
  • en-CA
  • en-IND
  • en-MS
  • en-NEP
  • en-NG
  • en-NZ
  • en-PAK
  • en-PH
  • en-SG
  • en-UG
  • en-ZA
  • es
  • es-AR
  • es-MX
  • es-PY
  • fi-FI
  • fr
  • fr-CA
  • fr-CH
  • he
  • hr
  • hu
  • hy
  • id
  • in-ID
  • it
  • ja
  • ko
  • lv
  • nb-NO
  • nl
  • no-NO
  • pl
  • pt
  • pt-BR
  • ru
  • sk
  • sv
  • th
  • tr
  • uk
  • vi
  • zh-CN
  • zh-TW

@panilya
Copy link
Copy Markdown
Collaborator Author

panilya commented Oct 6, 2022

Build is falling because it cannot find formats_international and formats_national in .yml files yet.

Comment thread src/test/java/net/datafaker/base/PhoneNumberTest.java Outdated
Comment thread src/main/resources/en-GB.yml Outdated
@panilya panilya force-pushed the phone-number-improvement branch from e38aa73 to 45325d1 Compare October 7, 2022 16:53
@panilya
Copy link
Copy Markdown
Collaborator Author

panilya commented Oct 11, 2022

@bodiam What if I add formats_international to all formats that have not been created yet, just to pass tests, and create an issue with the marked list of locales to be able to track the state of locales? Because, as for me, it will be better to let anybody implement an international format for locales

@bodiam
Copy link
Copy Markdown
Contributor

bodiam commented Oct 11, 2022

Shouldn't it fall back to a default format when it can't find it for the current locale?

I understand the format will be wrong then, which is fine, we can improve it as we go.

@panilya
Copy link
Copy Markdown
Collaborator Author

panilya commented Oct 12, 2022

@bodiam It's a good idea, but tests fall anyway, net.datafaker.integration.FakerIntegrationTest.testAllFakerMethodsThatReturnStrings(Locale, Random) throws phone_number.formats_international resulted in null expression exception. So, I don't know how to run tests successfully without adding duplicate international_formats.

Comment thread src/test/java/net/datafaker/base/PhoneNumberTest.java Outdated
@panilya panilya force-pushed the phone-number-improvement branch 2 times, most recently from 0f4e942 to 34400c5 Compare October 13, 2022 17:40
Comment thread src/test/java/net/datafaker/base/PhoneNumberTest.java Outdated
Comment thread src/test/java/net/datafaker/base/PhoneNumberTest.java Outdated
@panilya panilya force-pushed the phone-number-improvement branch from 34400c5 to 0353945 Compare October 13, 2022 18:12
Comment thread src/test/java/net/datafaker/base/PhoneNumberTest.java Outdated
@panilya panilya force-pushed the phone-number-improvement branch from 0353945 to ded33ff Compare October 13, 2022 18:18
Comment thread src/test/java/net/datafaker/base/PhoneNumberTest.java Outdated
Comment thread src/test/java/net/datafaker/base/PhoneNumberTest.java
@panilya panilya marked this pull request as ready for review October 20, 2022 16:39
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 21, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.01%. Comparing base (73f6a1b) to head (a8db23e).
Report is 1132 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #425      +/-   ##
============================================
+ Coverage     92.98%   93.01%   +0.02%     
- Complexity     2096     2099       +3     
============================================
  Files           233      233              
  Lines          4376     4378       +2     
  Branches        450      450              
============================================
+ Hits           4069     4072       +3     
- Misses          187      190       +3     
+ Partials        120      116       -4     

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

@panilya panilya merged commit 16fb4cf into datafaker-net:main Oct 22, 2022
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.

4 participants