json2xml icon indicating copy to clipboard operation
json2xml copied to clipboard

fix: cleanup code

Open vinitkumar opened this issue 6 months ago • 2 comments

Summary by Sourcery

Clean up test code and lint configuration by removing redundant type imports in TYPE_CHECKING blocks and re-enabling unused import detection.

Enhancements:

  • Simplify TYPE_CHECKING blocks in test files by replacing imported type definitions with a pass statement to reduce boilerplate.

Build:

  • Remove ‘F401’ (unused import) from lint.ignore in pyproject.toml to enforce unused import detection.

vinitkumar avatar Aug 29 '25 10:08 vinitkumar

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR removes redundant type-only imports from test modules and tightens linting rules by re-enabling unused-import checks.

File-Level Changes

Change Details Files
Clean up TYPE_CHECKING blocks in test files
  • Removed multiple pytest and pytest-mock type imports
  • Replaced imports with a pass statement in TYPE_CHECKING
tests/test_dict2xml.py
tests/test_utils.py
Re-enable unused-import linting
  • Removed 'F401' from lint.ignore in pyproject.toml
pyproject.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Aug 29 '25 10:08 sourcery-ai[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 100.00%. Comparing base (5f226ca) to head (d737811).

Additional details and impacted files
@@             Coverage Diff             @@
##           master      #248      +/-   ##
===========================================
+ Coverage   99.30%   100.00%   +0.69%     
===========================================
  Files           3         3              
  Lines         288       288              
===========================================
+ Hits          286       288       +2     
+ Misses          2         0       -2     
Flag Coverage Δ
unittests 100.00% <100.00%> (+0.69%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 29 '25 10:08 codecov[bot]