Skip to content

881 usethis tool import linter doesnt give message for ignoring inp#885

Merged
nathanjmcdougall merged 3 commits intomainfrom
881-usethis-tool-import-linter-doesnt-give-message-for-ignoring-inp
Jul 22, 2025
Merged

881 usethis tool import linter doesnt give message for ignoring inp#885
nathanjmcdougall merged 3 commits intomainfrom
881-usethis-tool-import-linter-doesnt-give-message-for-ignoring-inp

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

No description provided.

…ding Import Linter.

Also change the rule management methods on `Tool` to return `bool` for whether rules were added.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_selected to be more descriptive.
            with change_cwd(uv_init_dir), files_manager():

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Jul 22, 2025

CodSpeed Instrumentation Performance Report

Merging #885 will not alter performance

Comparing 881-usethis-tool-import-linter-doesnt-give-message-for-ignoring-inp (572faf5) with main (b139e3a)

Summary

✅ 2 untouched benchmarks

@nathanjmcdougall nathanjmcdougall merged commit 4927e0a into main Jul 22, 2025
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 881-usethis-tool-import-linter-doesnt-give-message-for-ignoring-inp branch July 22, 2025 05:59
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.

usethis tool import-linter doesn't give message for ignoring INP

2 participants