astral-sh / astral-sh/ruff

per-file-ignores have inconsistent behavior in symlinked directories

Open
#6,480 18 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
49.7k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
458

Description

I am trying to ignore the `S101` rule in tests. I have a base `ruff.toml` which is used in `pyproject.toml`.

Adding this to `ruff.toml` doesn't work:

```toml
[per-file-ignores]
"**/test/**" = ["S101"] # <- still warnings in tests
```

However, adding the same in `pyproject.toml` works:
```toml
[tool.ruff]
extend = "/path/to/ruff.toml"

[tool.ruff.per-file-ignores]
"**/test/**" = ["S101"] # <- this works as expected
```

I tried without wildcards as well and `extend-per-file-ignores`. Nothing added to `ruff.toml` is considered.

Ruff version: `0.0.284`

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior using the shown ruff.toml and pyproject.toml configurations, including a symlinked directory and the S101 rule. Then trace how Ruff loads per-file-ignores from each configuration and matches paths; done means equivalent ignore behavior in both locations, with coverage for symlinked directories.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.