-
Notifications
You must be signed in to change notification settings - Fork 25
chore: Fix some style issues #283
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
Conversation
Reviewer's GuideCentralize the tuple-parsing regex into a reusable constant and update type annotations and docstrings to use Python 3 union syntax. Updated Class Diagram for cms_component.py ModuleclassDiagram
class cms_component_py {
+ _TUPLE_RE : re.Pattern
+ _to_tuple_if_needed(value: str) : str | tuple[str, str]
+ split(value: str, delimiter: str = "|") : list[str | tuple[str, str]]
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #283 +/- ##
=======================================
Coverage 88.68% 88.69%
=======================================
Files 124 124
Lines 3386 3387 +1
Branches 289 289
=======================================
+ Hits 3003 3004 +1
Misses 265 265
Partials 118 118 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 @fsbraun - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
match = _TUPLE_RE.fullmatch(value) | ||
if match: |
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 (code-quality): Use named expression to simplify assignment and conditional (use-named-expression
)
match = _TUPLE_RE.fullmatch(value) | |
if match: | |
if match := _TUPLE_RE.fullmatch(value): |
Summary by Sourcery
Refactor tuple parsing to use a compiled regex and update type annotations to use PEP 604 union syntax.
Enhancements:
|
union operator (e.g.,str|tuple[str,str]
,list[str|tuple[str,str]]
).