feat: add Spanish DNI/NIF generator to ID generator by SetyVII · Pull Request #1906 · datafaker-net/datafaker · GitHub
Skip to content

feat: add Spanish DNI/NIF generator to ID generator - #1906

Open
SetyVII wants to merge 2 commits into
datafaker-net:mainfrom
SetyVII:main
Open

feat: add Spanish DNI/NIF generator to ID generator#1906
SetyVII wants to merge 2 commits into
datafaker-net:mainfrom
SetyVII:main

Conversation

@SetyVII

@SetyVII SetyVII commented Sep 4, 2026

Copy link
Copy Markdown

Summary

This PR adds support for generating Spanish DNI/NIF identification numbers.

Faker faker = new Faker(Locale.forLanguageTag("es-ES"));

String validDni = faker.idNumber().valid();
String invalidDni = faker.idNumber().invalid();

This initial implementation covers the standard DNI/NIF format for Spanish
nationals.

Tests for Spanish ID number generation are included.

Official references:

@what-the-diff

what-the-diff Bot commented Sep 4, 2026

Copy link
Copy Markdown

@codecov-commenter

Copy link
Copy Markdown

⚠️ 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 92.35%. Comparing base (14edbe2) to head (fd462f1).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1906      +/-   ##
============================================
+ Coverage     92.28%   92.35%   +0.06%     
- Complexity     3597     3604       +7     
============================================
  Files           348      349       +1     
  Lines          7115     7127      +12     
  Branches        695      695              
============================================
+ Hits           6566     6582      +16     
+ Misses          376      374       -2     
+ Partials        173      171       -2     

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kingthorin

kingthorin commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

@asolntsev asolntsev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

But check Grok's comment.

@asolntsev asolntsev added this to the 3.0.0 milestone Sep 4, 2026
@asolntsev asolntsev added the enhancement New feature or request label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants