PY-76811 Conformance test failure: dataclasses_slots.py

- support @dataclass(slots=True)
- add inspection for conflict with explicit __slots__
- add quickfix for new inspection
- add/adjust tests

GitOrigin-RevId: 5ac6efeb6c1e209b641365e2f22bdca74ae6484a
This commit is contained in:
Marcus Mews
2025-09-18 08:08:12 +00:00
committed by intellij-monorepo-bot
parent fc84fd71df
commit 3914253777
31 changed files with 436 additions and 118 deletions
@@ -1011,9 +1011,11 @@ INSP.NAME.deprecated.function.class.or.module=Deprecated function, class, or mod
INSP.deprecation.abc.decorator.deprecated.use.alternative=''{0}'' is deprecated since Python 3.3. Use ''{1}'' with ''{2}'' instead
# PyDunderSlotsInspection
INSP.NAME.dunder.slots=Invalid usages of classes with '__slots__' definitions
INSP.dunder.slots.name.in.slots.conflicts.with.class.variable=''{0}'' in __slots__ conflicts with a class variable
INSP.dunder.slots.class.object.attribute.read.only=''{0}'' object attribute ''{1}'' is read-only
INSP.NAME.dunder.slots=Invalid usages of classes with '__slots__' definitions
INSP.dunder.slots.name.in.slots.conflicts.with.class.variable=''{0}'' in '__slots__' conflicts with a class variable
INSP.dunder.slots.class.object.missing.attribute=''{0}'' object has no attribute ''{1}''
INSP.dunder.slots.enabled.twice=A data class that explicitly defines '__slots__' must not be configured with 'slots=True'
QFIX.dunder.slots.enabled.twice=Remove slots=True
# PyFinalInspection
INSP.NAME.final.classes.methods.and.variables=Invalid usages of final classes, methods, and variables