Skip to content

Add Support for Alphanumeric CNPJ#1644

Merged
henriquemoody merged 1 commit intoRespect:mainfrom
valdeirpsr:main
Feb 4, 2026
Merged

Add Support for Alphanumeric CNPJ#1644
henriquemoody merged 1 commit intoRespect:mainfrom
valdeirpsr:main

Conversation

@valdeirpsr
Copy link

Adds validation and tests for new CNPJ registrations, which will accept alphanumeric characters starting from July 2026.

The change was instituted through "Instrução Normativa RFB nº 2.119/2022".

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.53%. Comparing base (d8e31db) to head (0296328).
⚠️ Report is 23 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1644      +/-   ##
============================================
+ Coverage     99.00%   99.53%   +0.53%     
+ Complexity      962      929      -33     
============================================
  Files           197      190       -7     
  Lines          2214     2170      -44     
============================================
- Hits           2192     2160      -32     
+ Misses           22       10      -12     

☔ 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.

Copy link
Member

@alganet alganet left a comment

Choose a reason for hiding this comment

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

@valdeirpsr thanks for your contribution! 🐼

Support for the alphanumerical format would be nice to mention in the documentation (Cnpj.md file). This is not required for us to accept the change, but I believe it's a nice to have.

I'll give some time for other maintainers to review it as well.

Once we're done with reviews and modifications, are you willing to rebase it into a single commit?

Copy link
Member

@henriquemoody henriquemoody left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution, @valdeirpsr! 🐼

We don't use conventional commits, could you squash all your comments into a single one, that just describes what and why these changes we made? It would be awesome! It's okay if you don't do that, but we will squash it ourselves.

@valdeirpsr valdeirpsr force-pushed the main branch 2 times, most recently from a93fe57 to c3abe8a Compare January 31, 2026 13:00
@valdeirpsr
Copy link
Author

Thank you for the contribution, @valdeirpsr! 🐼

We don't use conventional commits, could you squash all your comments into a single one, that just describes what and why these changes we made? It would be awesome! It's okay if you don't do that, but we will squash it ourselves.

Sure! Change made.

@alganet
Copy link
Member

alganet commented Jan 31, 2026

@valdeirpsr can you run bin/console lint:docs --fix

It will automatically adjust documentation to conventions and also update the validators.md index.

@valdeirpsr valdeirpsr force-pushed the main branch 2 times, most recently from 346e347 to 4feb662 Compare January 31, 2026 17:25
@alganet
Copy link
Member

alganet commented Feb 3, 2026

@henriquemoody can I merge this one?

@henriquemoody
Copy link
Member

It's still using conventional commit message, but it's fine. Until we have an actual check I find it unfair to expect that from contributors

@henriquemoody
Copy link
Member

So, yes, by all means!

@alganet
Copy link
Member

alganet commented Feb 4, 2026

@valdeirpsr I'll wait for a little more. If you can reformat the commit title (just drop the feat:), it will then match the repo guidelines.

Thanks for your patience with us, and again, thanks for the contribution! 🐼

Due to the continuous increase in the number of companies and the
imminent exhaustion of available CNPJs (Brazilian taxpayer
identification numbers), the Brazilian Federal Revenue Service is
instituting the alphanumeric CNPJ. The initiative aims to
facilitate the identification of all companies and improve the
business environment, contributing to the economic and social
development of Brazil.

The alphanumeric CNPJ will be assigned, starting in July 2026,
exclusively to new registrations.

Changes:

- Add support for alphanumeric CNPJ validation
- Format code according to PHPCS standards
- Simplify CNPJ conversion to uppercase character array
- Add documentation about CNPJ structure
@valdeirpsr
Copy link
Author

@valdeirpsr I'll wait for a little more. If you can reformat the commit title (just drop the feat:), it will then match the repo guidelines.

Thanks for your patience with us, and again, thanks for the contribution! 🐼

Ops!! The change has been made. I'm sorry for any minor mistakes.
Let me know if you need anything.

@valdeirpsr valdeirpsr changed the title feat: Add Support for Alphanumeric CNPJ Add Support for Alphanumeric CNPJ Feb 4, 2026
@henriquemoody henriquemoody merged commit 570ba48 into Respect:main Feb 4, 2026
7 checks passed
@henriquemoody
Copy link
Member

Thank you for contributing, @valdeirpsr !

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