Skip to content
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

Fix nl phone format #3050

Merged
merged 2 commits into from
Feb 26, 2025
Merged

Conversation

klaaspieter
Copy link
Contributor

Motivation / Background

This Pull Request has been created because faker generates invalid Dutch phone numbers.

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug, refactor something, or add a feature.
  • Tests and Rubocop are passing before submitting your proposed changes.

If you're proposing a new generator or locale:

  • Double-check the existing generators documentation to make sure the new generator you want to add doesn't already exist.
  • You've reviewed and followed the Contributing guidelines.

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you share a bit more of why these are valid now?

@klaaspieter
Copy link
Contributor Author

Sure! Previously Dutch phone numbers were using a fallback country code (I don't recall the exact one) which made them invalid. I think technically the only thing to make them valid is to use the correct +31 country code.

My PR also adds cell phone number format because only numbers starting with 06 are valid Dutch cell phone numbers. The 06 prefix is reserved for that purpose.

Thinking about it I think I could update my PR so that 06 numbers are part of the normal format as well because they are valid phone number. I think my change makes it so they will never be generated when asking for a normal phone number. Only when asking for a cell phone number.

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing more context. LGTM 👍🏼

@stefannibrasil stefannibrasil merged commit 3b6efaf into faker-ruby:main Feb 26, 2025
7 checks passed
@klaaspieter klaaspieter deleted the fix-nl-phone-format branch February 27, 2025 10:44
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.

2 participants