Skip to content

Ensure test directory ignore rules are only added if the /tests exists#1232

Merged
nathanjmcdougall merged 4 commits intomainfrom
1041-for-import-linter-dont-add-config-relating-to-disabling-inp-for-the-tests-directory-unless-it-exists
Dec 28, 2025
Merged

Ensure test directory ignore rules are only added if the /tests exists#1232
nathanjmcdougall merged 4 commits intomainfrom
1041-for-import-linter-dont-add-config-relating-to-disabling-inp-for-the-tests-directory-unless-it-exists

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

Resolves #1041

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 fixes an issue where Ruff test directory ignore rules were being added to pyproject.toml even when the /tests directory doesn't exist in the project. The change adds a conditional check to verify the directory exists before adding test-specific configuration.

Key Changes:

  • Added existence check for tests/ directory before applying test-specific Ruff ignore rules
  • Added test case to verify ignore rules are not added when tests/ directory is missing

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/usethis/_tool/impl/ruff.py Added conditional check to verify tests/ directory exists before adding test-specific ignore rules
tests/usethis/_ui/interface/test_tool.py Added test case verifying that test directory ignore rules are not added when directory doesn't exist

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 28, 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 Dec 28, 2025

CodSpeed Performance Report

Merging #1232 will not alter performance

Comparing 1041-for-import-linter-dont-add-config-relating-to-disabling-inp-for-the-tests-directory-unless-it-exists (dbb928f) with main (c0daf78)

Summary

✅ 2 untouched

@nathanjmcdougall nathanjmcdougall merged commit de72743 into main Dec 28, 2025
19 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 1041-for-import-linter-dont-add-config-relating-to-disabling-inp-for-the-tests-directory-unless-it-exists branch December 28, 2025 10:24
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.

For Import Linter, don't add config relating to disabling INP for the tests directory unless it exists

2 participants