881 usethis tool import linter doesnt give message for ignoring inp#885
Conversation
…ding Import Linter. Also change the rule management methods on `Tool` to return `bool` for whether rules were added.
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issue #881 by modifying the import linter tool to provide proper user feedback when INP rules need to be ignored for test directories. The changes ensure that users receive clear messages about what configuration changes are being made, particularly when rules are already selected but need per-file ignores.
- Modified rule management methods to return boolean indicators of whether changes were made
- Added conditional messaging logic to show per-file ignore messages when no other rule changes occur
- Enhanced test coverage to verify the correct messages are displayed in different scenarios
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/usethis/_tool/base.py | Updated base class method signatures to return boolean values and added comprehensive docstrings |
| src/usethis/_tool/impl/ruff.py | Modified rule management methods to return success indicators and implemented conditional messaging for per-file ignores |
| src/usethis/_tool/impl/deptry.py | Updated deptry tool implementation to match new boolean return type interface |
| src/usethis/_io.py | Added clarifying documentation about list extension behavior |
| tests/usethis/_core/test_core_tool.py | Enhanced test cases to verify correct console output messages for different rule configuration scenarios |
Comments suppressed due to low confidence (1)
tests/usethis/_core/test_core_tool.py:388
- [nitpick] The test method name could be more specific about what scenario it's testing. Consider renaming to something like
test_shows_ignore_message_when_inp_already_selectedto be more descriptive.
with change_cwd(uv_init_dir), files_manager():
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
CodSpeed Instrumentation Performance ReportMerging #885 will not alter performanceComparing Summary
|
No description provided.