-
Notifications
You must be signed in to change notification settings - Fork 17
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
Issue 1334 #1335
Issue 1334 #1335
Conversation
Reviewer's Guide by SourceryThis pull request addresses two issues. The first is a bug in the fix mode of rule MD031, which was not correctly handling a specific edge case involving nested block quotes, lists, and fenced code blocks. The second is an enhancement to rule MD044, adding a configuration option to disable checking for proper names within inline code spans. Sequence diagram for MD031 fix mode special case handlingsequenceDiagram
participant F as fix_spacing_special_case
participant T as TokenStack
participant C as ContainerAdjustments
F->>T: get_container_stack_size()
F->>T: get_container_stack_item(index)
loop through stack
F->>T: Check for list start token
alt found list start
F->>C: Add pending adjustment
F->>F: Create new end token
end
end
F->>F: Create replacement tokens
F->>F: Register replace request
Class diagram for MD044 rule changesclassDiagram
class RuleMd044 {
-proper_name_list: List[str]
-check_in_code_blocks: bool
-check_in_code_spans: bool
-is_in_code_block: bool
-names: str
-replacement_items: List[FoundReplacement]
+initialize_from_config()
+query_config()
-handle_inline_code_span()
}
note for RuleMd044 "Added check_in_code_spans config
to control proper name checking
in inline code spans"
Class diagram for MD031 rule fix mode changesclassDiagram
class RuleMd031 {
-fix_count: int
-last_token: MarkdownToken
-container_adjustments: List
-leading_space_index_tracker: TokenStack
-fix_spacing_special_case()
}
note for RuleMd031 "Enhanced special case handling
for nested block quotes and lists"
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 @@
## main #1335 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 191 191
Lines 21607 21618 +11
Branches 3994 3996 +2
=========================================
+ Hits 21607 21618 +11 ☔ View full report in Codecov by Sentry. |
#1334
Summary by Sourcery
Fix a bug in MD031 that caused an assert error during the fix stage when a fenced code block was inside a block quote inside a list inside a block quote. Add a "code_spans" configuration option to MD044 to complement the existing "code_blocks" option.
Bug Fixes:
Enhancements:
Tests: