feat: adds HTMXConfig for plugin customization#6
Merged
Conversation
Reviewer's Guide by SourceryThis pull request introduces an Sequence diagram for HTMXPlugin initialization and app configurationsequenceDiagram
participant User
participant HTMXPlugin
participant AppConfig
User->>HTMXPlugin: Initialize with HTMXConfig
HTMXPlugin->>HTMXConfig: Create default if none provided
HTMXPlugin->>AppConfig: on_app_init(AppConfig)
alt set_request_class_globally is True
HTMXPlugin->>AppConfig: Set request_class to HTMXRequest
else set_request_class_globally is False
HTMXPlugin->>AppConfig: Keep request_class as None
end
Class diagram for HTMXConfig and HTMXPluginclassDiagram
class HTMXConfig {
bool set_request_class_globally
}
class HTMXPlugin {
HTMXConfig _config
+HTMXPlugin(HTMXConfig config)
+HTMXConfig config()
+AppConfig on_app_init(AppConfig app_config)
}
HTMXPlugin --> HTMXConfig
note for HTMXConfig "Configuration for HTMX Plugin, including setting request class globally."
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes
Summary by Sourcery
Add
HTMXConfigclass to enable customization of the HTMX plugin, allowing users to configure whether theHTMXRequestclass is set globally. UpdateHTMXPluginto utilize this configuration and add corresponding tests to ensure correct behavior.New Features:
HTMXConfigclass to allow customization of the HTMX plugin.Enhancements:
HTMXPluginto accept an optionalHTMXConfigparameter for configuration.Tests:
HTMXPluginto verify behavior ofset_request_class_globallyconfiguration.