[cpf fmt] Create package to format CPF - #22
Conversation
- Revised summary and description to clarify the purpose of the gem as a formatter of CPF (Brazilian Individual's Taxpayer ID). - Removed changelog URI from metadata for simplification. Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe PR replaces the placeholder CPF gem with a complete Ruby formatter, including input normalization, configurable masking and delimiters, post-processing, option merging, structured errors, public APIs, documentation, and comprehensive RSpec coverage. ChangesCPF formatter implementation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant CpfFmt
participant CpfFormatter
participant Utils
Caller->>CpfFmt: call cpf_fmt(cpf_input, options)
CpfFmt->>CpfFormatter: construct and format
CpfFormatter->>Utils: normalize and sanitize CPF
Utils-->>CpfFormatter: sanitized digits
CpfFormatter->>Utils: mask, delimit, escape, or encode
Utils-->>CpfFormatter: formatted CPF
CpfFormatter-->>Caller: return result or on_fail output
Possibly related issues
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cpf-fmt/README.md`:
- Around line 235-242: Reorder the summary table rows alphabetically within each
category by placing CpfFmt::InvalidArgumentCombinationError before
CpfFmt::TypeMismatchError. Apply this row swap in packages/cpf-fmt/README.md
lines 235-242 and packages/cpf-fmt/README.pt.md lines 222-229; leave the
domain-error rows unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1fab7430-e69f-4377-9ece-f36fdfda8651
📒 Files selected for processing (16)
packages/cpf-fmt/CHANGELOG.mdpackages/cpf-fmt/README.mdpackages/cpf-fmt/README.pt.mdpackages/cpf-fmt/cpf-fmt.gemspecpackages/cpf-fmt/src/cpf-fmt.rbpackages/cpf-fmt/src/cpf-fmt/cpf_fmt.rbpackages/cpf-fmt/src/cpf-fmt/cpf_formatter.rbpackages/cpf-fmt/src/cpf-fmt/cpf_formatter_options.rbpackages/cpf-fmt/src/cpf-fmt/errors.rbpackages/cpf-fmt/src/cpf-fmt/types.rbpackages/cpf-fmt/src/cpf-fmt/utils.rbpackages/cpf-fmt/tests/cpf_fmt.spec.rbpackages/cpf-fmt/tests/cpf_formatter.spec.rbpackages/cpf-fmt/tests/cpf_formatter_options.spec.rbpackages/cpf-fmt/tests/errors.spec.rbpackages/cpf-fmt/tests/utils.spec.rb
Adjustment as per @coderabbitai review comment at #22 (comment). Co-authored-by: CodeRabbit AI <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Adjustment as per @coderabbitai review comment at #22 (comment). Co-authored-by: CodeRabbit AI <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Adjustment as per @coderabbitai review comment at #22 (comment). Co-authored-by: CodeRabbit AI <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Adjustment as per @coderabbitai review comment at #22 (comment). Co-authored-by: CodeRabbit AI <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Adjustment as per @coderabbitai review comment at #22 (comment). Co-authored-by: CodeRabbit AI <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Adjustment as per @coderabbitai review comment at #22 (comment). Co-authored-by: CodeRabbit AI <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Adjustment as per @coderabbitai review comment at #22 (comment). Co-authored-by: CodeRabbit AI <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Adjustment as per @coderabbitai review comment at #22 (comment). Co-authored-by: CodeRabbit AI <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Cursor Grok 4.5 <cursoragent@cursor.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Summary by CodeRabbit
cpf-fmtRuby gem with CPF formatting/normalization, delimiter customization, privacy masking, HTML escaping and/or URL encoding, plus consistent failure handling.CpfFmt::CpfFormatterand theCpfFmt.cpf_fmtconvenience helper.cpf-fmt.