PY-57582 dataclasses: field with default value preceding KW_ONLY shows false-positive warning

- support marker field typed with KW_ONLY
- adjust other inspection message

GitOrigin-RevId: 28f30ffcc3400bc719c63eacd76e432a547a1a9c
This commit is contained in:
Marcus Mews
2025-09-26 07:22:47 +00:00
committed by intellij-monorepo-bot
parent 041ec1f6e2
commit eb3eeb0fca
12 changed files with 99 additions and 44 deletions
@@ -400,6 +400,11 @@ public class PyDataclassInspectionTest extends PyInspectionTestCase {
doMultiFileTest();
}
// PY-57582
public void testFieldsOrderKwOnly() {
doTest();
}
// PY-49946
public void testFieldsOrderOverridden() {
doTest();
@@ -25,6 +25,10 @@ public class PyNamedTupleInspectionTest extends PyInspectionTestCase {
runWithLanguageLevel(LanguageLevel.PYTHON36, this::doTest);
}
public void testTypingNTFieldsOrderKWOnly() {
doTest();
}
@NotNull
@Override
protected Class<? extends PyInspection> getInspectionClass() {