Ruff 0.16 introduces new default checks
- Dominant language
- No language data
- Stars
- 150
- Forks
- 38
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
Follow-up / recurrence of #180, which covered the same phenomenon for Ruff 0.12.
## What happened
[Ruff 0.16.0](https://github.com/astral-sh/ruff/releases/tag/0.16.0) again expands the default rule selection. Because the skeleton's `ruff.toml` uses `extend-select` (extending Ruff's built-in default rather than pinning an explicit `select`), every skeleton-based project is suddenly linted against a much larger set of rules it never opted into.
On 0.16 the built-in default enables ~830 rules vs. the classic `E4,E7,E9,F`. Reproduce:
```
ruff check --isolated --select "E4,E7,E9,F" # clean
ruff check --isolated # now flags RUF012, S110, BLE001, ...
```
## Impact observed
- `pypa/distutils`: 57 new failures remaining after `ruff check --fix --unsafe-fixes` (RUF012 ×33, SIM115 ×11, BLE001 ×3, plus RUF059, PLW0602, S102/S110, SIM102/117, PT031); repaired in [pypa/distutils@1c66bcd3](https://github.com/pypa/distutils/commit/1c66bcd3391fe20195b129ec2610b95712838c87).
- `pypa/setuptools` (main): 265 failures.
- Probably every other downstream project.
## A concrete regression worth flagging
The new default rule **PLC0414** (`import-alias-does-not-rename`) flags the intentional `import X as X` re-export idiom, and its fix strips the alias; F401 then deletes the now-"unused" import. In `distutils/errors.py` this silently removed the public re-exports `CompileError`, `LibError`, `LinkError`, `PreprocessError`, breaking `from distutils.errors import CompileError`. Any skeleton project relying on `import X as X` for re-export is similarly exposed.
## Plan
Nothing in particular needs to be done for skeleton. Maybe someone will want to bump the pinned version in pre-commit, but I'm not accepting that burden. Maybe the ruff config can now be simplified based on the new defaults.
Downstream projects should adopt these defaults as soon as possible. Given the impact, I might have been tempted to temporarily suppress these new defaults, but with the advent of AI, I'm more inclined to just fix everything. This issue tracks the repair of the downstream projects.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the skeleton's ruff.toml and reproduce the two Ruff commands from the issue using Ruff 0.16. Review the reported PLC0414 behavior and the downstream distutils/errors.py example. Done requires a clearly chosen, scoped skeleton change; the issue currently says that nothing in particular needs to be done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100