Improve conditional readability with predicates#70
Conversation
Reviewer's GuideThis PR refactors conditional checks into named predicate functions to improve readability and maintainability, replacing inline comparisons in HTML parsing, cell splitting, and separator detection logic with descriptive helpers. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary by CodeRabbit
WalkthroughRefactor inline conditional checks into dedicated helper functions across several modules. Move repeated tag comparisons in HTML parsing and markdown table logic into named functions, improving code organisation. No changes are made to the overall logic, control flow, or public interfaces, except for the addition of new private helpers. Changes
Sequence Diagram(s)sequenceDiagram
participant Parser as HTML/Markdown Parser
participant Helper as Helper Functions
Parser->>Helper: is_ignored_tag(tag)
Helper-->>Parser: true/false
Parser->>Helper: is_bold_tag(tag)
Helper-->>Parser: true/false
Parser->>Helper: next_is_pipe(iterator)
Helper-->>Parser: true/false
Parser->>Helper: should_use_second_row_as_separator(sep_invalid, rows)
Helper-->>Parser: true/false
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (1)**/*.rsInstructions used from: Sources: 🔇 Additional comments (8)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
next_is_pipeis_ignored_tag<strong>/<b>tags viais_bold_tagshould_use_second_row_as_separatorTesting
make fmtmake lintmake testhttps://chatgpt.com/codex/tasks/task_e_6875754902248322a73b518208513235
Summary by Sourcery
Improve conditional readability by extracting and applying predicate helper functions across HTML parsing, cell splitting, and table separator detection
Enhancements: