Skip to content

fix: small lint cleanups in currency, enums, and legal process - #764

Open
inquilabee wants to merge 2 commits into
brazilian-utils:mainfrom
inquilabee:fix/small-lint-cleanups
Open

fix: small lint cleanups in currency, enums, and legal process#764
inquilabee wants to merge 2 commits into
brazilian-utils:mainfrom
inquilabee:fix/small-lint-cleanups

Conversation

@inquilabee

@inquilabee inquilabee commented Jul 29, 2026

Copy link
Copy Markdown

Summary

Repo health: 52/100

Our analysis found 15 format issues and about 128 refactoring opportunities
across the reviewed scope. Your core validation utilities are well covered by tests
(175 unittest cases passed locally), and several security-oriented checks reported
no secrets. This pull request is a sample of those findings — 4 files with
roughly 11 focused changes so far — and is not a complete format pass or refactor cleanup.

Hotspots and improvement notes below are scoped to Python (*.py) source.

What you are doing right

  • No secrets were detected in the scanned scope (gitleaks).
  • Python code duplication stayed below the configured threshold (jscpd on Python sources).
  • File-level maintainability scores passed the radon maintenance-index gate for scanned modules.

What you could improve

Changes

  • brutils/currency.py: return formatted currency directly without an intermediate variable.
  • brutils/data/enums/better_enum.py: simplify values property with a sorted generator expression.
  • brutils/data/enums/months.py: replace ternary with direct set membership in is_valid_month.
  • brutils/legal_process.py: use [:7] instead of [0:7] in checksum input.
  • tests/test_date_utils.py: add coverage for MonthsEnum.is_valid_month.

Review summary produced with ShipGate — a policy-first quality orchestrator that runs linters, formatters, security scanners, and refactor checks from one catalog. This PR used check + refactor check --strict to find issues; docs.

Remove an unnecessary intermediate variable before return, simplify enum
value collection, tighten month validation, and drop a redundant slice index.

Co-authored-by: Cursor <cursoragent@cursor.com>
@inquilabee
inquilabee requested review from a team as code owners July 29, 2026 07:01
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.22%. Comparing base (2398edb) to head (9f0d184).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #764      +/-   ##
==========================================
+ Coverage   99.09%   99.22%   +0.12%     
==========================================
  Files          26       26              
  Lines         775      774       -1     
==========================================
  Hits          768      768              
+ Misses          7        6       -1     

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

Add unit tests so the simplified is_valid_month implementation stays
fully covered for codecov patch checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant