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

Use array of chars instead of String builder in DocumentFormatterUtil#cpf where length is predicted #977

Merged
merged 1 commit into from
Oct 1, 2023

Conversation

snuyanzin
Copy link
Collaborator

No description provided.

@what-the-diff
Copy link

what-the-diff bot commented Oct 1, 2023

PR Summary

  • Improvement in Document Formatting
    The changes in DocumentFormatterUtil.java now allow better and more accurate formatting of CPF numbers. This is done by the inclusion of periods and dashes at the appropriate places in the number.

  • Enhanced CPF Number Generation
    The logic in IdNumberGeneratorPtBrUtil.java has been modified. It now generates valid CPF numbers as character arrays, which it then converts to strings. This ensures the generation of correctly formatted CPF numbers.

  • CPF Format Validation Additions
    A new function has been added in CPFTest.java. This function uses regular expressions (a way to match patterns in data) to check that the CPF number is in the correct format. This addition increases the robustness of the format validation process.

@codecov-commenter
Copy link

codecov-commenter commented Oct 1, 2023

Codecov Report

Merging #977 (9ad4dc6) into main (8d79729) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

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

@@             Coverage Diff              @@
##               main     #977      +/-   ##
============================================
- Coverage     92.33%   92.24%   -0.09%     
+ Complexity     2760     2757       -3     
============================================
  Files           289      289              
  Lines          5518     5522       +4     
  Branches        601      601              
============================================
- Hits           5095     5094       -1     
- Misses          270      274       +4     
- Partials        153      154       +1     
Files Coverage Δ
...tafaker/idnumbers/pt/br/DocumentFormatterUtil.java 100.00% <100.00%> (ø)
...ker/idnumbers/pt/br/IdNumberGeneratorPtBrUtil.java 92.85% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kingthorin kingthorin merged commit d7ade4f into datafaker-net:main Oct 1, 2023
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.

3 participants