Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions conformance/results/mypy/dataclasses_usage.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ notes = """
Does not detect unannotated usage of `dataclasses.field()`.
"""
output = """
dataclasses_usage.py:35: error: Accessing "__init__" on an instance is unsound, since instance.__init__ could be from an incompatible subclass [misc]
dataclasses_usage.py:50: error: Missing positional argument "unit_price" in call to "InventoryItem" [call-arg]
dataclasses_usage.py:51: error: Argument 2 to "InventoryItem" has incompatible type "str"; expected "float" [arg-type]
dataclasses_usage.py:52: error: Too many arguments for "InventoryItem" [call-arg]
dataclasses_usage.py:61: error: Attributes without a default cannot follow attributes with one [misc]
dataclasses_usage.py:67: error: Attributes without a default cannot follow attributes with one [misc]
dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one [misc]
dataclasses_usage.py:83: error: Too many arguments for "DC4" [call-arg]
dataclasses_usage.py:88: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
dataclasses_usage.py:127: error: Too many arguments for "DC7" [call-arg]
dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" [call-arg]
dataclasses_usage.py:179: error: Too many arguments for "DC13" [call-arg]
dataclasses_usage.py:36: error: Accessing "__init__" on an instance is unsound, since instance.__init__ could be from an incompatible subclass [misc]
dataclasses_usage.py:51: error: Missing positional argument "unit_price" in call to "InventoryItem" [call-arg]
dataclasses_usage.py:52: error: Argument 2 to "InventoryItem" has incompatible type "str"; expected "float" [arg-type]
dataclasses_usage.py:53: error: Too many arguments for "InventoryItem" [call-arg]
dataclasses_usage.py:62: error: Attributes without a default cannot follow attributes with one [misc]
dataclasses_usage.py:68: error: Attributes without a default cannot follow attributes with one [misc]
dataclasses_usage.py:74: error: Attributes without a default cannot follow attributes with one [misc]
dataclasses_usage.py:84: error: Too many arguments for "DC4" [call-arg]
dataclasses_usage.py:89: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
dataclasses_usage.py:128: error: Too many arguments for "DC7" [call-arg]
dataclasses_usage.py:131: error: Missing positional argument "y" in call to "DC8" [call-arg]
dataclasses_usage.py:180: error: Too many arguments for "DC13" [call-arg]
dataclasses_usage.py:246: error: Too many arguments for "DC19" [call-arg]
"""
conformance_automated = "Pass"
errors_diff = """
Expand Down
1 change: 1 addition & 0 deletions conformance/results/mypy/enums_definition.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ conformant = "Pass"
errors_diff = """
"""
output = """
enums_definition.py:92: error: "type[Color12]" has no attribute "BLUE" [attr-defined]
"""
conformance_automated = "Pass"
44 changes: 26 additions & 18 deletions conformance/results/mypy/namedtuples_define_class.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
conformant = "Partial"
notes = """
Does not reject override of named tuple attribute in child class.
Does not support version-conditional fields.
"""
output = """
namedtuples_define_class.py:32: error: Tuple index out of range [misc]
namedtuples_define_class.py:33: error: Tuple index out of range [misc]
namedtuples_define_class.py:44: error: Missing positional argument "y" in call to "Point" [call-arg]
namedtuples_define_class.py:34: error: Tuple index out of range [misc]
namedtuples_define_class.py:45: error: Missing positional argument "y" in call to "Point" [call-arg]
namedtuples_define_class.py:46: error: Argument 2 to "Point" has incompatible type "str"; expected "int" [arg-type]
namedtuples_define_class.py:47: error: Argument "units" to "Point" has incompatible type "int"; expected "str" [arg-type]
namedtuples_define_class.py:48: error: Too many arguments for "Point" [call-arg]
namedtuples_define_class.py:49: error: Unexpected keyword argument "other" for "Point" [call-arg]
namedtuples_define_class.py:59: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]
namedtuples_define_class.py:65: error: Missing positional argument "units" in call to "Point2" [call-arg]
namedtuples_define_class.py:67: error: Too many values to unpack (2 expected, 3 provided) [misc]
namedtuples_define_class.py:76: error: NamedTuple field name cannot start with an underscore: _y [misc]
namedtuples_define_class.py:86: error: Non-default NamedTuple fields cannot follow default fields [misc]
namedtuples_define_class.py:125: error: Argument 2 to "Property" has incompatible type "float"; expected "str" [arg-type]
namedtuples_define_class.py:132: error: NamedTuple should be a single base [misc]
namedtuples_define_class.py:46: error: Missing positional argument "y" in call to "Point" [call-arg]
namedtuples_define_class.py:47: error: Argument 2 to "Point" has incompatible type "str"; expected "int" [arg-type]
namedtuples_define_class.py:48: error: Argument "units" to "Point" has incompatible type "int"; expected "str" [arg-type]
namedtuples_define_class.py:49: error: Too many arguments for "Point" [call-arg]
namedtuples_define_class.py:50: error: Unexpected keyword argument "other" for "Point" [call-arg]
namedtuples_define_class.py:60: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]
namedtuples_define_class.py:66: error: Missing positional argument "units" in call to "Point2" [call-arg]
namedtuples_define_class.py:68: error: Too many values to unpack (2 expected, 3 provided) [misc]
namedtuples_define_class.py:77: error: NamedTuple field name cannot start with an underscore: _y [misc]
namedtuples_define_class.py:87: error: Non-default NamedTuple fields cannot follow default fields [misc]
namedtuples_define_class.py:114: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]
namedtuples_define_class.py:116: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]
namedtuples_define_class.py:120: error: Too many arguments for "ConditionalField" [call-arg]
namedtuples_define_class.py:121: error: Too many arguments for "ConditionalField" [call-arg]
namedtuples_define_class.py:140: error: Argument 2 to "Property" has incompatible type "float"; expected "str" [arg-type]
namedtuples_define_class.py:147: error: NamedTuple should be a single base [misc]
"""
conformance_automated = "Fail"
errors_diff = """
Line 69: Expected 1 errors
Line 106: Expected 1 errors
Line 59: Unexpected errors ['namedtuples_define_class.py:59: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]']
Line 65: Unexpected errors ['namedtuples_define_class.py:65: error: Missing positional argument "units" in call to "Point2" [call-arg]']
Line 67: Unexpected errors ['namedtuples_define_class.py:67: error: Too many values to unpack (2 expected, 3 provided) [misc]']
Line 70: Expected 1 errors
Line 107: Expected 1 errors
Line 60: Unexpected errors ['namedtuples_define_class.py:60: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]']
Line 66: Unexpected errors ['namedtuples_define_class.py:66: error: Missing positional argument "units" in call to "Point2" [call-arg]']
Line 68: Unexpected errors ['namedtuples_define_class.py:68: error: Too many values to unpack (2 expected, 3 provided) [misc]']
Line 114: Unexpected errors ['namedtuples_define_class.py:114: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]']
Line 116: Unexpected errors ['namedtuples_define_class.py:116: error: Invalid statement in NamedTuple definition; expected "field_name: field_type [= default]" [misc]']
Line 120: Unexpected errors ['namedtuples_define_class.py:120: error: Too many arguments for "ConditionalField" [call-arg]']
"""
24 changes: 17 additions & 7 deletions conformance/results/mypy/typeddicts_class_syntax.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
conformant = "Pass"
conformant = "Partial"
notes = """
Does not support version-conditional items in TypedDict definitions.
"""
output = """
typeddicts_class_syntax.py:29: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]
typeddicts_class_syntax.py:33: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]
typeddicts_class_syntax.py:38: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]
typeddicts_class_syntax.py:44: error: Unexpected keyword argument "metaclass" for "__init_subclass__" of "TypedDict" [call-arg]
typeddicts_class_syntax.py:49: error: Unexpected keyword argument "other" for "__init_subclass__" of "TypedDict" [call-arg]
typeddicts_class_syntax.py:30: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]
typeddicts_class_syntax.py:34: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]
typeddicts_class_syntax.py:39: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]
typeddicts_class_syntax.py:45: error: Unexpected keyword argument "metaclass" for "__init_subclass__" of "TypedDict" [call-arg]
typeddicts_class_syntax.py:50: error: Unexpected keyword argument "other" for "__init_subclass__" of "TypedDict" [call-arg]
typeddicts_class_syntax.py:58: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]
typeddicts_class_syntax.py:60: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]
typeddicts_class_syntax.py:64: error: Extra key "y" for TypedDict "ConditionalField" [typeddict-unknown-key]
typeddicts_class_syntax.py:65: error: Extra keys ("y", "z") for TypedDict "ConditionalField" [typeddict-unknown-key]
"""
conformance_automated = "Pass"
conformance_automated = "Fail"
errors_diff = """
Line 58: Unexpected errors ['typeddicts_class_syntax.py:58: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]']
Line 60: Unexpected errors ['typeddicts_class_syntax.py:60: error: Invalid statement in TypedDict definition; expected "field_name: field_type" [misc]']
Line 64: Unexpected errors ['typeddicts_class_syntax.py:64: error: Extra key "y" for TypedDict "ConditionalField" [typeddict-unknown-key]']
"""
23 changes: 12 additions & 11 deletions conformance/results/pyrefly/dataclasses_usage.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ conformance_automated = "Pass"
errors_diff = """
"""
output = """
ERROR dataclasses_usage.py:50:19-27: Missing argument `unit_price` in function `InventoryItem.__init__` [missing-argument]
ERROR dataclasses_usage.py:51:28-35: Argument `Literal['price']` is not assignable to parameter `unit_price` with type `float` in function `InventoryItem.__init__` [bad-argument-type]
ERROR dataclasses_usage.py:52:36-37: Expected 3 positional arguments, got 4 in function `InventoryItem.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:61:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition]
ERROR dataclasses_usage.py:67:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition]
ERROR dataclasses_usage.py:73:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition]
ERROR dataclasses_usage.py:83:13-14: Expected 1 positional argument, got 2 in function `DC4.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:88:14-40: `str` is not assignable to `int` [bad-assignment]
ERROR dataclasses_usage.py:127:8-9: Expected 1 positional argument, got 2 in function `DC7.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:130:4-7: Missing argument `y` in function `DC8.__init__` [missing-argument]
ERROR dataclasses_usage.py:179:6-7: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:51:19-27: Missing argument `unit_price` in function `InventoryItem.__init__` [missing-argument]
ERROR dataclasses_usage.py:52:28-35: Argument `Literal['price']` is not assignable to parameter `unit_price` with type `float` in function `InventoryItem.__init__` [bad-argument-type]
ERROR dataclasses_usage.py:53:36-37: Expected 3 positional arguments, got 4 in function `InventoryItem.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:62:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition]
ERROR dataclasses_usage.py:68:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition]
ERROR dataclasses_usage.py:74:5-6: Dataclass field `b` without a default may not follow dataclass field with a default [bad-class-definition]
ERROR dataclasses_usage.py:84:13-14: Expected 1 positional argument, got 2 in function `DC4.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:89:14-40: `str` is not assignable to `int` [bad-assignment]
ERROR dataclasses_usage.py:128:8-9: Expected 1 positional argument, got 2 in function `DC7.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:131:4-7: Missing argument `y` in function `DC8.__init__` [missing-argument]
ERROR dataclasses_usage.py:180:6-7: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:246:12-13: Expected 2 positional arguments, got 3 in function `DC19.__init__` [bad-argument-count]
"""
1 change: 1 addition & 0 deletions conformance/results/pyrefly/enums_definition.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ conformance_automated = "Pass"
errors_diff = """
"""
output = """
ERROR enums_definition.py:92:1-13: Class `Color12` has no class attribute `BLUE` [missing-attribute]
"""
29 changes: 15 additions & 14 deletions conformance/results/pyrefly/namedtuples_define_class.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ conformance_automated = "Pass"
errors_diff = """
"""
output = """
ERROR namedtuples_define_class.py:32:10-11: Index 3 out of range for tuple with 3 elements [bad-index]
ERROR namedtuples_define_class.py:33:10-12: Index -4 out of range for tuple with 3 elements [bad-index]
ERROR namedtuples_define_class.py:44:11-14: Missing argument `y` in function `Point.__new__` [missing-argument]
ERROR namedtuples_define_class.py:45:11-16: Missing argument `y` in function `Point.__new__` [missing-argument]
ERROR namedtuples_define_class.py:46:15-17: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `Point.__new__` [bad-argument-type]
ERROR namedtuples_define_class.py:47:24-25: Argument `Literal[3]` is not assignable to parameter `units` with type `str` in function `Point.__new__` [bad-argument-type]
ERROR namedtuples_define_class.py:48:22-24: Expected 3 positional arguments, got 4 in function `Point.__new__` [bad-argument-count]
ERROR namedtuples_define_class.py:49:23-28: Unexpected keyword argument `other` in function `Point.__new__` [unexpected-keyword]
ERROR namedtuples_define_class.py:69:20-22: Expected 2 positional arguments, got 3 in function `Point2.__new__` [bad-argument-count]
ERROR namedtuples_define_class.py:76:5-7: NamedTuple field name may not start with an underscore: `_y` [bad-class-definition]
ERROR namedtuples_define_class.py:86:5-13: NamedTuple field 'latitude' without a default may not follow NamedTuple field with a default [bad-class-definition]
ERROR namedtuples_define_class.py:106:5-6: Cannot override named tuple element `x` [bad-override]
ERROR namedtuples_define_class.py:125:19-22: Argument `float` is not assignable to parameter `value` with type `str` in function `Property.__new__` [bad-argument-type]
ERROR namedtuples_define_class.py:132:7-11: Named tuples do not support multiple inheritance [invalid-inheritance]
ERROR namedtuples_define_class.py:33:10-11: Index 3 out of range for tuple with 3 elements [bad-index]
ERROR namedtuples_define_class.py:34:10-12: Index -4 out of range for tuple with 3 elements [bad-index]
ERROR namedtuples_define_class.py:45:11-14: Missing argument `y` in function `Point.__new__` [missing-argument]
ERROR namedtuples_define_class.py:46:11-16: Missing argument `y` in function `Point.__new__` [missing-argument]
ERROR namedtuples_define_class.py:47:15-17: Argument `Literal['']` is not assignable to parameter `y` with type `int` in function `Point.__new__` [bad-argument-type]
ERROR namedtuples_define_class.py:48:24-25: Argument `Literal[3]` is not assignable to parameter `units` with type `str` in function `Point.__new__` [bad-argument-type]
ERROR namedtuples_define_class.py:49:22-24: Expected 3 positional arguments, got 4 in function `Point.__new__` [bad-argument-count]
ERROR namedtuples_define_class.py:50:23-28: Unexpected keyword argument `other` in function `Point.__new__` [unexpected-keyword]
ERROR namedtuples_define_class.py:70:20-22: Expected 2 positional arguments, got 3 in function `Point2.__new__` [bad-argument-count]
ERROR namedtuples_define_class.py:77:5-7: NamedTuple field name may not start with an underscore: `_y` [bad-class-definition]
ERROR namedtuples_define_class.py:87:5-13: NamedTuple field 'latitude' without a default may not follow NamedTuple field with a default [bad-class-definition]
ERROR namedtuples_define_class.py:107:5-6: Cannot override named tuple element `x` [bad-override]
ERROR namedtuples_define_class.py:121:24-25: Expected 2 positional arguments, got 3 in function `ConditionalField.__new__` [bad-argument-count]
ERROR namedtuples_define_class.py:140:19-22: Argument `float` is not assignable to parameter `value` with type `str` in function `Property.__new__` [bad-argument-type]
ERROR namedtuples_define_class.py:147:7-11: Named tuples do not support multiple inheritance [invalid-inheritance]
"""
11 changes: 6 additions & 5 deletions conformance/results/pyrefly/typeddicts_class_syntax.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ conformance_automated = "Pass"
errors_diff = """
"""
output = """
ERROR typeddicts_class_syntax.py:29:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition]
ERROR typeddicts_class_syntax.py:34:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition]
ERROR typeddicts_class_syntax.py:39:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition]
ERROR typeddicts_class_syntax.py:44:7-20: Metaclass of `BadTypedDict2` has type `type[Any]` that is not a simple class type [invalid-inheritance]
ERROR typeddicts_class_syntax.py:49:7-20: TypedDict does not support keyword argument `other` [bad-typed-dict]
ERROR typeddicts_class_syntax.py:30:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition]
ERROR typeddicts_class_syntax.py:35:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition]
ERROR typeddicts_class_syntax.py:40:9-16: TypedDict members must be declared in the form `field: Annotation` with no assignment [bad-class-definition]
ERROR typeddicts_class_syntax.py:45:7-20: Metaclass of `BadTypedDict2` has type `type[Any]` that is not a simple class type [invalid-inheritance]
ERROR typeddicts_class_syntax.py:50:7-20: TypedDict does not support keyword argument `other` [bad-typed-dict]
ERROR typeddicts_class_syntax.py:65:17-32: No matching overload found for function `ConditionalField.__init__` called with arguments: (x=Literal[1], y=Literal[2], z=Literal[3]) [no-matching-overload]
"""
Loading