Skip to content

Commit 6a2d358

Browse files
authored
[refurb] Make example error out-of-the-box (FURB180) (#19672)
<!-- Thank you for contributing to Ruff/ty! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? (Please prefix with `[ty]` for ty pull requests.) - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Part of #18972 This PR makes [meta-class-abc-meta (FURB180)](https://docs.astral.sh/ruff/rules/meta-class-abc-meta/#meta-class-abc-meta-furb180)'s example error out-of-the-box. [Old example](https://play.ruff.rs/6beca1be-45cd-4e5a-aafa-6a0584c10d64) ```py class C(metaclass=ABCMeta): pass ``` [New example](https://play.ruff.rs/bbad34da-bf07-44e6-9f34-53337e8f57d4) ```py import abc class C(metaclass=abc.ABCMeta): pass ``` The "Use instead" section as also modified similarly. ## Test Plan <!-- How was it tested? --> N/A, no functionality/tests affected
1 parent b07def0 commit 6a2d358

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

crates/ruff_linter/src/rules/refurb/rules/metaclass_abcmeta.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,19 @@ use crate::{AlwaysFixableViolation, Edit, Fix};
2222
///
2323
/// ## Example
2424
/// ```python
25-
/// class C(metaclass=ABCMeta):
25+
/// import abc
26+
///
27+
///
28+
/// class C(metaclass=abc.ABCMeta):
2629
/// pass
2730
/// ```
2831
///
2932
/// Use instead:
3033
/// ```python
31-
/// class C(ABC):
34+
/// import abc
35+
///
36+
///
37+
/// class C(abc.ABC):
3238
/// pass
3339
/// ```
3440
///

0 commit comments

Comments
 (0)