---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
 --> FURB180.py:7:10
  |
5 | # Errors
6 |
7 | class A0(metaclass=abc.ABCMeta):
  |          ^^^^^^^^^^^^^^^^^^^^^
8 |     @abstractmethod
9 |     def foo(self): pass
  |
help: Replace with `abc.ABC`
  |
6 |
  - class A0(metaclass=abc.ABCMeta):
7 + class A0(abc.ABC):
8 |     @abstractmethod
  |

FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
  --> FURB180.py:12:10
   |
12 | class A1(metaclass=ABCMeta):
   |          ^^^^^^^^^^^^^^^^^
13 |     @abstractmethod
14 |     def foo(self): pass
   |
help: Replace with `abc.ABC`
   |
11 |
   - class A1(metaclass=ABCMeta):
12 + class A1(abc.ABC):
13 |     @abstractmethod
   |

FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
  --> FURB180.py:26:18
   |
26 | class A2(B0, B1, metaclass=ABCMeta):
   |                  ^^^^^^^^^^^^^^^^^
27 |     @abstractmethod
28 |     def foo(self): pass
   |
help: Replace with `abc.ABC`
   |
25 |
   - class A2(B0, B1, metaclass=ABCMeta):
26 + class A2(B0, B1, abc.ABC):
27 |     @abstractmethod
   |
note: This is an unsafe fix and may change runtime behavior

FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
  --> FURB180.py:31:34
   |
31 | class A3(B0, before_metaclass=1, metaclass=abc.ABCMeta):
   |                                  ^^^^^^^^^^^^^^^^^^^^^
32 |     pass
   |
help: Replace with `abc.ABC`
   |
30 |
   - class A3(B0, before_metaclass=1, metaclass=abc.ABCMeta):
31 + class A3(B0, abc.ABC, before_metaclass=1):
32 |     pass
   |
note: This is an unsafe fix and may change runtime behavior

FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
  --> FURB180.py:62:19
   |
61 | # Regression tests for https://github.com/astral-sh/ruff/issues/17162
62 | class A8(abc.ABC, metaclass=ABCMeta):  # FURB180
   |                   ^^^^^^^^^^^^^^^^^
63 |     @abstractmethod
64 |     def foo(self):
   |
help: Replace with `abc.ABC`
   |
61 | # Regression tests for https://github.com/astral-sh/ruff/issues/17162
   - class A8(abc.ABC, metaclass=ABCMeta):  # FURB180
62 + class A8(abc.ABC):  # FURB180
63 |     @abstractmethod
   |
note: This is an unsafe fix and may change runtime behavior

FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
  --> FURB180.py:71:19
   |
69 |     from abc import ABC
70 |
71 |     class A9(ABC, metaclass=ABCMeta):  # FURB180
   |                   ^^^^^^^^^^^^^^^^^
72 |         @abstractmethod
73 |         def foo(self):
   |
help: Replace with `abc.ABC`
   |
70 |
   -     class A9(ABC, metaclass=ABCMeta):  # FURB180
71 +     class A9(ABC):  # FURB180
72 |         @abstractmethod
   |
note: This is an unsafe fix and may change runtime behavior

FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
  --> FURB180.py:80:35
   |
78 |     from abc import ABC as ABCAlternativeName
79 |
80 |     class A10(ABCAlternativeName, metaclass=ABCMeta):  # FURB180
   |                                   ^^^^^^^^^^^^^^^^^
81 |         @abstractmethod
82 |         def foo(self):
   |
help: Replace with `abc.ABC`
   |
79 |
   -     class A10(ABCAlternativeName, metaclass=ABCMeta):  # FURB180
80 +     class A10(ABCAlternativeName):  # FURB180
81 |         @abstractmethod
   |
note: This is an unsafe fix and may change runtime behavior

FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
  --> FURB180.py:89:24
   |
89 | class A11(MyMetaClass, metaclass=ABCMeta):  # FURB180
   |                        ^^^^^^^^^^^^^^^^^
90 |     @abstractmethod
91 |     def foo(self):
   |
help: Replace with `abc.ABC`
   |
88 |
   - class A11(MyMetaClass, metaclass=ABCMeta):  # FURB180
89 + class A11(MyMetaClass):  # FURB180
90 |     @abstractmethod
   |
note: This is an unsafe fix and may change runtime behavior

FURB180 [*] Use of `metaclass=abc.ABCMeta` to define abstract base class
   --> FURB180.py:98:5
    |
 96 |     keyword_argument=1,
 97 |     # comment
 98 |     metaclass=abc.ABCMeta,
    |     ^^^^^^^^^^^^^^^^^^^^^
 99 | ):  # FURB180
100 |     pass
    |
help: Replace with `abc.ABC`
   |
95 | class A12(
   -     keyword_argument=1,
   -     # comment
   -     metaclass=abc.ABCMeta,
96 +     abc.ABC, keyword_argument=1,
97 | ):  # FURB180
   |
note: This is an unsafe fix and may change runtime behavior
