ruff
ruff copied to clipboard
Read user configuration from `~/.config/ruff/ruff.toml` on macOS
Summary
This PR moves Ruff's user-specific configuration from ~/Library/Application Support/ruff/ruff.toml to ~/.config/ruff/ruff.toml.
Many other tools do this. On my machine alone: dagger, zed, gatsby, gh, wandb, etc.
I also polled Twitter and it won in a landslide:
Let's ship this in v0.5.0, along with a deprecation warning (so we'll continue to respect ~/Library/Application Support/ruff/ruff.toml, but log a warning).
Closes https://github.com/astral-sh/ruff/issues/10739.
Test Plan
- Created a file with an unused import.
- Ran
cargo check foo.py. - Verified that the deprecated configuration was loaded and respected, with a warning:
warning: Reading configuration from `~/Library/Application Support` is deprecated. Please move your configuration to `/Users/crmarsh/.config/ruff/ruff/ruff.toml`.
[2024-04-23][16:09:10][ruff::resolve][DEBUG] Using configuration file (via cwd) at: /Users/crmarsh/Library/Application Support/ruff/ruff.toml
- Created
~/.config/ruff/ruff.toml. - Verified that the new configuration was loaded:
[2024-04-23][16:10:23][ruff::resolve][DEBUG] Using configuration file (via cwd) at: /Users/crmarsh/.config/ruff/ruff.toml
ruff-ecosystem results
Linter (stable)
✅ ecosystem check detected no linter changes.
Linter (preview)
✅ ecosystem check detected no linter changes.
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
Sooo, we're doing twitter driven development now :joy:
I would change the reasoning/description: Follow the XDG specification on all Unix platforms. Ruff will now use the XDG config directory to read user-level configuration (default: ~/.config/ruff/ruff.toml) over Library/Application Support/ruff/ruff.toml on macOS.
CodSpeed Performance Report
Merging #11115 will degrade performances by 4.69%
Comparing charlie/xdg (c4d143a) with ruff-0.5 (9348821)
Summary
❌ 1 regressions
✅ 29 untouched benchmarks
:warning: Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
| Benchmark | ruff-0.5 |
charlie/xdg |
Change | |
|---|---|---|---|---|
| ❌ | linter/default-rules[pydantic/types.py] |
1.8 ms | 1.9 ms | -4.69% |
I ran through the test plan and verified the deprecation message.