Skip to content

[refurb] Allow subclassing builtins in stub files (FURB189) - #26812

Merged
ntBre merged 2 commits into
mainfrom
brent/furb189-stubs
Jul 15, 2026
Merged

[refurb] Allow subclassing builtins in stub files (FURB189)#26812
ntBre merged 2 commits into
mainfrom
brent/furb189-stubs

Conversation

@ntBre

@ntBre ntBre commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

While looking at rule stabilization candidates for 0.16, I noticed that #15291 has been blocking
stabilization of this rule for quite a while despite being a one-line change. I decided to make that
one-line change since it seemed sensible to me. I'll still plan to hold off on stabilization until
this change has been in preview for a release cycle, but this should pave the way to stabilization
in 0.17.

Closed #15291

Test Plan

New mdtest showing that the rule is inactive in stub files

Summary
--

While looking at rule stabilization candidates for 0.16, I noticed that #15291 has been blocking
stabilization of this rule for quite a while despite being a one-line change. I decided to make that
one-line change since it seemed sensible to me. I'll still plan to hold off on stabilization until
this change has been in preview for a release cycle, but this should pave the way to stabilization
in 0.17.

Closed #15291

Test Plan
--

New mdtest showing that the rule is inactive in stub files
@ntBre ntBre added rule Implementing or modifying a lint rule preview Related to preview mode features labels Jul 14, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -2 violations, +0 -0 fixes in 2 projects; 54 projects unchanged)

bokeh/bokeh (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview --select ALL

- src/typings/bs4.pyi:12:17: subclass-builtin Subclassing `list` can be error prone, use `collections.UserList` instead

home-assistant/core (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-fix --output-format concise --preview

- homeassistant/util/hass_dict.pyi:31:16: subclass-builtin Subclassing `dict` can be error prone, use `collections.UserDict` instead

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
subclass-builtin 2 0 2 0 0

@ntBre
ntBre marked this pull request as ready for review July 14, 2026 19:48
@ntBre
ntBre merged commit 98ab666 into main Jul 15, 2026
47 checks passed
@ntBre
ntBre deleted the brent/furb189-stubs branch July 15, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Related to preview mode features rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should subclass-builtin (FURB189) not apply to stubs?

2 participants