Skip to content

Add options and filename kwargs to testing wrappers#36

Open
ggueret wants to merge 1 commit into
feat/utils-helpers-and-docstringfrom
feat/check-codes-configurable
Open

Add options and filename kwargs to testing wrappers#36
ggueret wants to merge 1 commit into
feat/utils-helpers-and-docstringfrom
feat/check-codes-configurable

Conversation

@ggueret
Copy link
Copy Markdown
Contributor

@ggueret ggueret commented May 28, 2026

Summary

  • Adds options= and filename= keyword arguments to all eight wrappers in rude.testing (check_source, check_codes, fix_source, assert_no_errors, assert_error, assert_error_count, assert_fix, assert_no_fix).
  • options=: instantiates the rule, then calls .configure(options) before checking. Plugin tests no longer need to bypass rude.testing to test configurable rules.
  • filename=: forwards to FileContext.path, useful for rules that branch on the path.

Context

Stacked on #35. Diff above main includes the utils helpers from that PR.

Test plan

  • check_source forwards options to rule.configure(); skips the call when options=None
  • check_source forwards filename to FileContext.path
  • fix_source forwards both
  • The 6 other wrappers (check_codes, assert_no_errors, assert_error, assert_error_count, assert_fix, assert_no_fix) accept and forward both kwargs

@ggueret ggueret self-assigned this May 28, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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