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

https://github.com/jackdewinter/pymarkdown/issues/1318 #1319

Merged
merged 7 commits into from
Jan 18, 2025

Conversation

jackdewinter
Copy link
Owner

@jackdewinter jackdewinter commented Jan 18, 2025

#1318

Summary by Sourcery

Tests:

  • Update test cases for the MD020 rule to use the new utility function.

Copy link
Contributor

sourcery-ai bot commented Jan 18, 2025

Reviewer's Guide by Sourcery

This pull request primarily focuses on enhancing the test suite for rule MD020, which checks for proper spacing in Atx Closed Headings. It also addresses an issue where escaped characters in headers were incorrectly triggering the rule. Additionally, it adds documentation for using alternate extensions with pre-commit and ports the performance scripts to shell scripts.

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

File-Level Changes

Change Details Files
Refactored test suite for rule MD020 to use parameterized tests.
  • Replaced individual test functions with a single parameterized test function.
  • Utilized pluginRuleTest and calculate_scan_tests to generate test cases.
  • Improved test coverage and maintainability.
test/rules/test_md020.py
Addressed issue with escaped characters in headers triggering rule MD020.
  • Modified the regex in rule_md_020.py to ignore escaped # characters.
  • Added new test cases in test_markdown_extra.py to verify the fix.
pymarkdown/plugins/rule_md_020.py
test/test_markdown_extra.py
Added documentation for using alternate extensions with pre-commit.
  • Documented how to configure pre-commit to scan files with alternate extensions.
  • Explained the need to override the default types setting in pre-commit.
  • Provided a detailed example of how to configure pre-commit for .qmd files.
newdocs/src/advanced_pre-commit.md
Ported performance scripts to shell scripts.
  • Replaced perf_*.cmd scripts with perf_*.sh scripts.
  • Modified run.sh to execute the python script directly.
  • Added logic to handle different operating systems.
run.sh
perf_series.sh
perf_sample.sh
Added tests for alternate extensions.
  • Added tests to verify that alternate extensions are handled correctly.
  • Added tests to verify that files with the correct extension are scanned.
test/test_main_alternate_extensions.py

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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard 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

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (14355b4) to head (d3d407d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1319   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          191       191           
  Lines        21590     21590           
  Branches      3991      3991           
=========================================
  Hits         21590     21590           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jackdewinter jackdewinter merged commit 661142a into main Jan 18, 2025
27 checks passed
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