-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔧 update default_settings.toml and main.py #384
Conversation
Reviewer's Guide by SourceryThis pull request updates the File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mraniki - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟡 Security: 1 issue found
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
self.library = kwargs.get("library", None) or kwargs.get( | ||
"parser_library", "standard" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider simplifying the library assignment logic.
The current logic for assigning self.library
can be simplified to self.library = kwargs.get("library") or kwargs.get("parser_library", "standard")
. This makes the code more readable.
self.library = kwargs.get("library", None) or kwargs.get( | |
"parser_library", "standard" | |
self.library = kwargs.get("library") or kwargs.get("parser_library", "standard") |
# logger.debug("Order identifier: {}", order_identifier) | ||
# logger.debug("Action identifiers: {}", self.action_identifiers) | ||
if order_identifier in self.action_identifier: | ||
|
||
# logger.debug("Order identifier found in {}", order_identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider removing commented-out debug statements.
The commented-out debug statements can be removed to keep the code clean and maintainable. If these logs are no longer needed, it's better to remove them entirely.
@@ -45,13 +45,15 @@ def __init__( | |||
""" | |||
|
|||
self.enabled = settings.findmyorder_enabled | |||
self.settings = settings.findmyorder | |||
logger.debug("Settings: {}", self.settings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 issue (security): Consider the security implications of logging settings.
Logging the entire settings object might expose sensitive information. Ensure that no sensitive data is included in the settings or consider logging only non-sensitive parts.
if not self.enabled: | ||
logger.info("Module is disabled. No Client will be created.") | ||
return | ||
self.client_classes = self.get_all_client_classes() | ||
self.clients = [] | ||
# Create a client for each client in settings.findmyorder | ||
for name, client_config in settings.findmyorder.items(): | ||
for name, client_config in self.settings.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): Check for potential NoneType in settings.
Ensure that self.settings
is not None before iterating over its items. This can prevent potential runtime errors.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #384 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 138 141 +3
=========================================
+ Hits 138 141 +3 ☔ View full report in Codecov by Sentry. |
Summary by Sourcery
Enhanced the handler initialization to support a library or parser_library and updated the default action_identifier to include 'DEFAULT'.