Skip to content

fix: remove extra plugin parameter#3

Merged
cofin merged 1 commit into
mainfrom
remove-config
Oct 21, 2024
Merged

fix: remove extra plugin parameter#3
cofin merged 1 commit into
mainfrom
remove-config

Conversation

@cofin

@cofin cofin commented Oct 21, 2024

Copy link
Copy Markdown
Member

Description

Closes

Summary by Sourcery

Remove an unnecessary configuration parameter from the HTMXPlugin class and add error handling for package metadata retrieval to improve robustness.

Bug Fixes:

  • Remove the unnecessary configuration parameter from the HTMXPlugin class, simplifying its initialization.

Enhancements:

  • Add error handling for package metadata retrieval to prevent crashes when the package is not found.

@sourcery-ai

sourcery-ai Bot commented Oct 21, 2024

Copy link
Copy Markdown

Reviewer's Guide by Sourcery

This pull request removes an unnecessary plugin parameter and updates the metadata handling in the litestar_htmx package. The changes simplify the plugin initialization and improve the package's metadata retrieval process.

Updated class diagram for HTMXPlugin

classDiagram
    class HTMXPlugin {
        +HTMXPlugin()
        +on_app_init(AppConfig) AppConfig
    }

    class InitPluginProtocol {
        <<interface>>
    }

    HTMXPlugin --|> InitPluginProtocol

    class AppConfig {
        <<interface>>
    }
Loading

File-Level Changes

Change Details Files
Simplify HTMXPlugin initialization by removing the config parameter
  • Remove HtmxConfig dataclass
  • Remove config parameter from HTMXPlugin init method
  • Remove unused import of TemplateConfig
litestar_htmx/plugin.py
Improve metadata handling with better import statements and error handling
  • Replace importlib.metadata import with specific imports
  • Add try-except block to handle PackageNotFoundError
  • Set default values for version and project if package is not found
  • Clean up imported names after use
litestar_htmx/__metadata__.py

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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a 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. You can also use
    this command to specify where the summary should be inserted.

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

@cofin
cofin merged commit 2064108 into main Oct 21, 2024
@cofin
cofin deleted the remove-config branch October 21, 2024 17:35
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