Skip to content
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 automod.py #77

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Update automod.py #77

merged 1 commit into from
Mar 5, 2024

Conversation

The-LukeZ
Copy link

Fixed AutoModTriggerMetadata.to_dict() because if you only provided regex_patterns it would return None. Now it doesnt.

Fixed AutoModTriggerMetadata.to_dict() because if you only provided regex_patterns it would return None. Now it doesnt.

Signed-off-by: LukeZ <[email protected]>
@The-LukeZ The-LukeZ marked this pull request as ready for review February 24, 2024 21:55
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Failed to review pull request #77 due to the following error:

<class 'KeyError'>: 0

Try re-running the review or contact [email protected] for help.

@The-LukeZ The-LukeZ marked this pull request as draft February 24, 2024 22:00
@The-LukeZ The-LukeZ marked this pull request as ready for review February 24, 2024 22:00
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

PR Type: Bug fix

PR Summary: The pull request updates the to_dict method in automod.py to ensure that it returns a dictionary with regex_patterns even when keyword_filter is not provided. This change addresses a specific issue where the method would return None if only regex_patterns were provided, which is now fixed.

Decision: Comment

📝 Type: 'Bug fix' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.

General suggestions:

  • Ensure comprehensive testing around the to_dict method to verify that it behaves as expected with various combinations of keyword_filter and _regex_patterns.
  • Consider adding more detailed documentation or comments in the code explaining the importance of this change for future maintainability.
  • Review other parts of the codebase that interact with the output of to_dict to ensure they correctly handle the scenarios where keyword_filter might be empty or None.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@mccoderpy mccoderpy linked an issue Feb 26, 2024 that may be closed by this pull request
@mccoderpy mccoderpy merged commit 026dac7 into mccoderpy:developer Mar 5, 2024
3 checks passed
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.

[Bug]: AutoMod rule fails to create
2 participants