astral-sh / astral-sh/ruff

Warn when an `include`, `lint.per-file-ignores` (maybe `exclude`) pattern does not match any files

Open
#28,107 4 comments 6 reactions 0 assignees View on GitHub
configuration
Dominant language
Rust
Stars
49.6k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
445

Description

After refactoring, especially if folders are renamed, we might sometimes forget to update the folder name in `ruff.toml` / `.ruff.toml` / `pyproject.toml`:

```toml
target-version = "py311"

line-length = 90

output-prefer-rule-codes = true

include = [
"py-src/**/*.{py,pyi}", # If the folder name has changed, for example, to "pysrc", ruff will simply say nothing
]
```

I'm not sure about the `exclude` patterns, since they might be generated somewhere in CI, and the user might not have those files locally, so I don't think we should do that for `exclude`

Contributor guide

Open the contributing guide

Research direction

Start by tracing how ruff.toml, .ruff.toml, and pyproject.toml settings are loaded and how include and lint.per-file-ignores patterns are matched. Check the existing behavior for patterns matching no files, while treating exclude as an explicit scope question. Done means the applicable unmatched patterns produce a clear warning without incorrectly warning for excluded or unavailable files.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.