Skip to content

make Brazilian ID Number accessible via faker.idNumber()#1631

Merged
asolntsev merged 1 commit into
mainfrom
feature/existing-id-numbers
Aug 30, 2025
Merged

make Brazilian ID Number accessible via faker.idNumber()#1631
asolntsev merged 1 commit into
mainfrom
feature/existing-id-numbers

Conversation

@asolntsev

@asolntsev asolntsev commented Aug 30, 2025

Copy link
Copy Markdown
Collaborator

Brazilian ID Number (aka CPF) was already available via

faker.cpf().valid()

but now it's also available via more generic

new Faker(new Locale("pt", "BR")).idNumber().valid()

CPF was already available via `faker.cpf().valid()`, but now it's also available via more generic `new Faker(new Locale("pt", "BR")).idNumber().valid()`.
@asolntsev asolntsev added this to the 2.4.5 milestone Aug 30, 2025
@what-the-diff

what-the-diff Bot commented Aug 30, 2025

Copy link
Copy Markdown

PR Summary

  • Creation of BrazilIdNumber class
    A new module has been added that enables the generation of Brazilian taxpayer numbers (also known as CPF). This development will add to the range of identification number generators in the system.

  • Improvement of IdNumberGeneratorPtBrUtil class
    This existing class has been made more secure by limiting access to certain methods. Extraneous and inefficient lines of code have also been taken out to make it more clean.

  • Update in IdNumber.java class
    A correction was made in the documentation of an obsolete method which now accurately indicates that it generates valid Portuguese ID numbers.

  • Services File Modification
    The newly created BrazilIdNumber class has been included in the official list of identification number generators. This allows its use across the application.

  • Upgrade of IdNumberPatterns
    A new verification pattern has been added for Brazilian CPF numbers. This measure will help create valid identification numbers and enrich the ID number generation capabilities.

  • New Tests Added for Brazilian ID numbers
    To ensure accuracy and reliability, a collection of tests have been added for Brazilian CPF numbers. These tests not only validate these numbers but also confirm that the system can generate both valid & invalid Brazilian CPFs.

@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.41%. Comparing base (a8cd4a2) to head (6e036fc).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1631      +/-   ##
============================================
+ Coverage     92.39%   92.41%   +0.02%     
- Complexity     3378     3382       +4     
============================================
  Files           332      333       +1     
  Lines          6664     6670       +6     
  Branches        664      664              
============================================
+ Hits           6157     6164       +7     
+ Misses          348      347       -1     
  Partials        159      159              

☔ View full report in Codecov by Sentry.
📢 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.

@asolntsev asolntsev self-assigned this Aug 30, 2025
@asolntsev asolntsev added the enhancement New feature or request label Aug 30, 2025
@asolntsev
asolntsev merged commit 64d2e15 into main Aug 30, 2025
13 checks passed
@asolntsev
asolntsev deleted the feature/existing-id-numbers branch August 30, 2025 12:17
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.

3 participants