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

Issue 990 #1002

Merged
merged 4 commits into from
Feb 17, 2024
Merged

Issue 990 #1002

merged 4 commits into from
Feb 17, 2024

Conversation

jackdewinter
Copy link
Owner

No description provided.

Copy link
Contributor

@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: 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? ✨

Share Sourcery

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

Copy link

codecov bot commented Feb 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c130f98) to head (2cfcc97).
Report is 52 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@jackdewinter jackdewinter merged commit 17ba688 into main Feb 17, 2024
14 checks passed
@jackdewinter jackdewinter deleted the issue-990 branch February 17, 2024 15:27
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.

1 participant