Add managed per-file-ignore support; ignore RUF059 in tests by default#1463
Merged
Conversation
…ault - Add `tests_ignored` and `nontests_ignored` fields to `RuleConfig` for managed per-file-ignores (can be removed when tool is removed) - Add `unignore_rules_in_glob` method to `RuffTool` for removing per-file-ignores - Update `apply_rule_config` to handle managed per-file-ignores - Update `remove_rule_config` to handle managed per-file-ignores - Add `RUF059` to `_get_basic_rule_config()` as a `tests_ignored` rule - Add tests for new behavior - Update existing test expectations Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/1a70829b-ea2b-443e-9475-5cd4a579a3b9
Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/1a70829b-ea2b-443e-9475-5cd4a579a3b9
Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/1a70829b-ea2b-443e-9475-5cd4a579a3b9
Copilot
AI
changed the title
[WIP] Disable unused variables rule in test suite for Ruff
Add managed per-file-ignore support; ignore RUF059 in tests by default
Mar 22, 2026
nathanjmcdougall
approved these changes
Mar 22, 2026
Merging this PR will degrade performance by 3.35%
Performance Changes
Comparing Footnotes |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Collaborator
|
@copilot please add a test for full coverage of |
Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/692d2eb5-b2c9-4970-8ec5-b1c5737da738
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests_ignoredandnontests_ignoredfields toRuleConfig(managed per-file-ignore equivalents of existing unmanaged fields)RuleConfigmethods:subset_related_to_tests,empty,is_related_to_tests,__repr__,__or__unignore_rules_in_globmethod toRuffToolapply_rule_configinRuffToolto handle managed per-file-ignoresremove_rule_configinRuffToolto handle managed per-file-ignoresRUF059to_get_basic_rule_config()as atests_ignoredruleRuleConfig.__repr__Original prompt
RUF059should not be used in the test suite by default #1186📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.