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

upgrades #1256

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

upgrades #1256

wants to merge 21 commits into from

Conversation

jackdewinter
Copy link
Owner

@jackdewinter jackdewinter commented Nov 9, 2024

upgrading build libraries

Summary by Sourcery

Refactor test cases for rule MD012 to use parameterized tests and update dependencies in the Pipfile. Enhance test coverage by adding new test cases and update the changelog with recent fixes.

Enhancements:

  • Refactor test cases for rule MD012 to use parameterized tests, improving test organization and maintainability.

Build:

  • Upgrade mypy to version 1.13.0, pytest to version 8.3.3, setuptools to version 75.3.0, and sourcery to version 1.24.0 in the Pipfile.

Documentation:

  • Update changelog to include a fix for issue 1208 related to blank lines separated with pragmas.

Tests:

  • Increase the total number of tests for rule MD012 from 12 to 15, enhancing test coverage.

Copy link
Contributor

sourcery-ai bot commented Nov 9, 2024

Reviewer's Guide by Sourcery

This PR primarily focuses on upgrading build libraries and refactoring test code. The main changes include updating dependency versions in Pipfile, refactoring test_md012.py to use parameterized tests, and fixing an issue with blank lines separated by pragmas.

Class diagram for test_md012.py refactoring

classDiagram
    class test_md012 {
        +execute_scan_test(test: pluginRuleTest, rule: str)
        +execute_configuration_test(test: pluginRuleTest, file: str)
    }
    class pluginRuleTest
    class pluginConfigErrorTest
    class id_test_plug_rule_fn
    test_md012 --> pluginRuleTest
    test_md012 --> pluginConfigErrorTest
    test_md012 --> id_test_plug_rule_fn
    note for test_md012 "Refactored to use parameterized tests"
Loading

Class diagram for rule_md_012.py changes

classDiagram
    class RuleMd012 {
        -__last_blank_line: MarkdownToken
        -__blank_line_count: int
        +next_token(context: PluginScanContext, token: MarkdownToken)
    }
    class PluginScanContext
    class MarkdownToken {
        +is_blank_line: bool
        +line_number: int
    }
    RuleMd012 --> PluginScanContext
    RuleMd012 --> MarkdownToken
    note for RuleMd012 "Added logic to check for excess blank lines"
Loading

File-Level Changes

Change Details Files
Refactored test code to use parameterized tests
  • Replaced individual test functions with parameterized test cases
  • Added test configuration and scan test arrays
  • Simplified test execution using utility functions
  • Added new test cases for pragma-separated blank lines
test/rules/test_md012.py
Updated build dependencies to newer versions
  • Upgraded mypy from 1.10.0 to 1.13.0
  • Upgraded pytest from 8.2.2 to 8.3.3
  • Upgraded setuptools from 75.1.0 to 75.3.0
  • Upgraded sourcery from 1.22.0 to 1.24.0
Pipfile
Pipfile.lock
Fixed blank line handling with pragmas
  • Added logic to handle non-consecutive blank lines
  • Updated blank line count reset conditions
  • Added test cases for blank lines with pragmas
pymarkdown/plugins/rule_md_012.py
Version and documentation updates
  • Bumped version from 0.9.24 to 0.9.25
  • Updated changelog with new version information
  • Updated coverage metrics
pymarkdown/version.py
newdocs/src/changelog.md
publish/coverage.json
publish/test-results.json

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
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.

Hey @jackdewinter - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

codecov bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.98%. Comparing base (2a9931e) to head (788c9a6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1256   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         191      191           
  Lines       21194    21197    +3     
  Branches     2715     2716    +1     
=======================================
+ Hits        21190    21193    +3     
  Misses          1        1           
  Partials        3        3           

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

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