Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces crucial updates to the Brazilian CNPJ validation and formatting utilities. It enables the system to correctly process the upcoming alphanumeric CNPJ format, which will be adopted starting July 2026, while ensuring that all existing numeric CNPJs continue to be handled without issue. The changes primarily involve adapting the character interpretation and validation logic to accommodate letters in the identifier's main body. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the CNPJ validation logic to support the new alphanumeric format starting in July 2026, while maintaining compatibility with legacy numeric-only CNPJs. The implementation correctly updates the checksum calculation and validation rules. I have provided a high-severity feedback comment suggesting that the clean function should normalize inputs to uppercase to ensure consistent checksum calculation and formatting for alphanumeric CNPJs.
Hi!
Brazil's CNPJ format is expanding to allow letters A-Z in the first 12 positions , while the last 2 check digits remain numeric.
Backward-compatible — existing numeric CNPJs validate identically.
Reference: https://kpmg.com/us/en/taxnewsflash/news/2026/03/tnf-brazi-new-alphanumeric-format-for-taxpayer-registry.html
This is my first contribution to this project, so happy to adjust the approach if it doesn't align with how you'd prefer to handle this. Let me know if any changes are needed!
And thank you!