jackdewinter / pymarkdown

MIT License
75 stars 17 forks source link

https://github.com/jackdewinter/pymarkdown/issues/1217 #1218

Closed jackdewinter closed 1 month ago

jackdewinter commented 1 month ago

closes #1217

Summary by Sourcery

Fix nested list parsing issue and enhance test coverage with new test cases for bad fenced blocks in nested lists. Refactor code to simplify method parameters and update the changelog with the latest bug fix.

Bug Fixes:

Enhancements:

Documentation:

Tests:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request addresses issue #1217 by fixing an issue with nested list starts not being accounted for properly in the pymarkdown project. The changes primarily affect the handling of fenced code blocks within nested lists and the calculation of line number deltas in the LeadingSpaceIndexTracker class.

No sequence diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added new test cases for fenced code blocks within nested lists
  • Added test_extra_047g0 and test_extra_047g1 for fenced blocks in lists with thematic breaks
  • Added test_extra_047g2 and test_extra_047g3 for fenced blocks in double-nested lists with thematic breaks
  • Updated existing test cases to reflect the new behavior
test/test_markdown_extra.py
test/rules/test_md031.py
Modified LeadingSpaceIndexTracker class to handle nested list starts correctly
  • Removed unnecessary parameter from process_container_end_block_quote method
  • Added condition to adjust line_number_delta in process_container_end_list method
  • Updated process_container_end method to use the modified __process_container_end_block_quote
pymarkdown/plugins/utils/leading_space_index_tracker.py
Updated project metadata and documentation
  • Incremented test coverage numbers in coverage.json
  • Updated test result counts in test-results.json
  • Added entry for Issue 1217 in the changelog
publish/coverage.json
publish/test-results.json
newdocs/src/changelog.md

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (e479453) to head (41eb15a). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1218 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 191 191 Lines 20983 20985 +2 Branches 2678 2679 +1 ========================================= + Hits 20983 20985 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.