-
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 990 #1002
Issue 990 #1002
Conversation
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.
PR Type: Bug fix
PR Summary: This pull request addresses issues with handling whitespace and tabs in ATX headings and ATX closed headings across various markdown rules within the pymarkdown project. Specifically, it improves the handling of spaces and tabs around headings in rules Md019 and Md021 by refining the logic for detecting and reporting multiple spaces in headings. Additionally, it includes updates to test cases to cover these changes.
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.
📝 Complexity: the changes are too large or complex for Sourcery to approve.
- Unsupported files: the diff contains files that Sourcery does not currently support during reviews.
General suggestions:
- Ensure that the refactoring and changes maintain backward compatibility with existing markdown documents.
- Consider adding more diverse test cases to cover edge cases not currently tested, especially with complex markdown elements within headings.
- Review the changes for potential impacts on performance, especially for large markdown files, given the additional processing for whitespace and tab handling.
pymarkdown/plugins/rule_md_019.py: The proposed code change simplifies and streamlines the logic, enhancing readability and maintainability.
After reviewing the proposed changes, it appears that the modifications actually streamline the existing logic rather than complicating it. By consolidating checks under a broader condition (if self.__atx_heading_token:
), the code reduces the depth of nested conditions and groups related operations more coherently. This approach not only enhances readability but also improves maintainability by focusing on operations relevant only when self.__atx_heading_token
is not None
. Additionally, by moving certain operations inside this conditional, the code avoids unnecessary processing, making it more efficient for cases where self.__atx_heading_token
is None
. Overall, these changes contribute to a more streamlined and understandable codebase.
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? ✨
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1002 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 189 189
Lines 19417 19442 +25
Branches 2411 2415 +4
=========================================
+ Hits 19417 19442 +25 ☔ View full report in Codecov by Sentry. |
No description provided.