@@ -35,17 +35,17 @@ def __str__(self) -> str:
35
35
CALL_ARG : Final [ErrorCode ] = ErrorCode (
36
36
"call-arg" , "Check number, names and kinds of arguments in calls" , "General"
37
37
)
38
- ARG_TYPE : Final = ErrorCode ("arg-type" , "Check argument types in calls" , "General" )
38
+ ARG_TYPE : Final [ ErrorCode ] = ErrorCode ("arg-type" , "Check argument types in calls" , "General" )
39
39
CALL_OVERLOAD : Final = ErrorCode (
40
40
"call-overload" , "Check that an overload variant matches arguments" , "General"
41
41
)
42
42
VALID_TYPE : Final [ErrorCode ] = ErrorCode (
43
43
"valid-type" , "Check that type (annotation) is valid" , "General"
44
44
)
45
- VAR_ANNOTATED : Final = ErrorCode (
45
+ VAR_ANNOTATED : Final [ ErrorCode ] = ErrorCode (
46
46
"var-annotated" , "Require variable annotation if type can't be inferred" , "General"
47
47
)
48
- OVERRIDE : Final = ErrorCode (
48
+ OVERRIDE : Final [ ErrorCode ] = ErrorCode (
49
49
"override" , "Check that method override is compatible with base class" , "General"
50
50
)
51
51
RETURN : Final [ErrorCode ] = ErrorCode (
@@ -54,28 +54,30 @@ def __str__(self) -> str:
54
54
RETURN_VALUE : Final [ErrorCode ] = ErrorCode (
55
55
"return-value" , "Check that return value is compatible with signature" , "General"
56
56
)
57
- ASSIGNMENT : Final = ErrorCode (
57
+ ASSIGNMENT : Final [ ErrorCode ] = ErrorCode (
58
58
"assignment" , "Check that assigned value is compatible with target" , "General"
59
59
)
60
60
TYPE_ARG : Final [ErrorCode ] = ErrorCode (
61
61
"type-arg" , "Check that generic type arguments are present" , "General"
62
62
)
63
63
TYPE_VAR : Final = ErrorCode ("type-var" , "Check that type variable values are valid" , "General" )
64
- UNION_ATTR : Final = ErrorCode (
64
+ UNION_ATTR : Final [ ErrorCode ] = ErrorCode (
65
65
"union-attr" , "Check that attribute exists in each item of a union" , "General"
66
66
)
67
- INDEX : Final = ErrorCode ("index" , "Check indexing operations" , "General" )
68
- OPERATOR : Final = ErrorCode ("operator" , "Check that operator is valid for operands" , "General" )
69
- LIST_ITEM : Final = ErrorCode (
67
+ INDEX : Final [ErrorCode ] = ErrorCode ("index" , "Check indexing operations" , "General" )
68
+ OPERATOR : Final [ErrorCode ] = ErrorCode (
69
+ "operator" , "Check that operator is valid for operands" , "General"
70
+ )
71
+ LIST_ITEM : Final [ErrorCode ] = ErrorCode (
70
72
"list-item" , "Check list items in a list expression [item, ...]" , "General"
71
73
)
72
- DICT_ITEM : Final = ErrorCode (
74
+ DICT_ITEM : Final [ ErrorCode ] = ErrorCode (
73
75
"dict-item" , "Check dict items in a dict expression {key: value, ...}" , "General"
74
76
)
75
- TYPEDDICT_ITEM : Final = ErrorCode (
77
+ TYPEDDICT_ITEM : Final [ ErrorCode ] = ErrorCode (
76
78
"typeddict-item" , "Check items when constructing TypedDict" , "General"
77
79
)
78
- HAS_TYPE : Final = ErrorCode (
80
+ HAS_TYPE : Final [ ErrorCode ] = ErrorCode (
79
81
"has-type" , "Check that type of reference can be determined" , "General"
80
82
)
81
83
IMPORT : Final = ErrorCode (
@@ -84,10 +86,10 @@ def __str__(self) -> str:
84
86
NO_REDEF : Final [ErrorCode ] = ErrorCode (
85
87
"no-redef" , "Check that each name is defined once" , "General"
86
88
)
87
- FUNC_RETURNS_VALUE : Final = ErrorCode (
89
+ FUNC_RETURNS_VALUE : Final [ ErrorCode ] = ErrorCode (
88
90
"func-returns-value" , "Check that called function returns a value in value context" , "General"
89
91
)
90
- ABSTRACT : Final = ErrorCode (
92
+ ABSTRACT : Final [ ErrorCode ] = ErrorCode (
91
93
"abstract" , "Prevent instantiation of classes with abstract attributes" , "General"
92
94
)
93
95
VALID_NEWTYPE : Final [ErrorCode ] = ErrorCode (
@@ -99,7 +101,7 @@ def __str__(self) -> str:
99
101
STR_BYTES_PY3 : Final [ErrorCode ] = ErrorCode (
100
102
"str-bytes-safe" , "Warn about dangerous coercions related to bytes and string types" , "General"
101
103
)
102
- EXIT_RETURN : Final = ErrorCode (
104
+ EXIT_RETURN : Final [ ErrorCode ] = ErrorCode (
103
105
"exit-return" , "Warn about too general return type for '__exit__'" , "General"
104
106
)
105
107
LITERAL_REQ : Final = ErrorCode (
@@ -110,29 +112,29 @@ def __str__(self) -> str:
110
112
NO_UNTYPED_DEF : Final [ErrorCode ] = ErrorCode (
111
113
"no-untyped-def" , "Check that every function has an annotation" , "General"
112
114
)
113
- NO_UNTYPED_CALL : Final = ErrorCode (
115
+ NO_UNTYPED_CALL : Final [ ErrorCode ] = ErrorCode (
114
116
"no-untyped-call" ,
115
117
"Disallow calling functions without type annotations from annotated functions" ,
116
118
"General" ,
117
119
)
118
- REDUNDANT_CAST : Final = ErrorCode (
120
+ REDUNDANT_CAST : Final [ ErrorCode ] = ErrorCode (
119
121
"redundant-cast" , "Check that cast changes type of expression" , "General"
120
122
)
121
- COMPARISON_OVERLAP : Final = ErrorCode (
123
+ COMPARISON_OVERLAP : Final [ ErrorCode ] = ErrorCode (
122
124
"comparison-overlap" , "Check that types in comparisons and 'in' expressions overlap" , "General"
123
125
)
124
- NO_ANY_UNIMPORTED : Final = ErrorCode (
126
+ NO_ANY_UNIMPORTED : Final [ ErrorCode ] = ErrorCode (
125
127
"no-any-unimported" , 'Reject "Any" types from unfollowed imports' , "General"
126
128
)
127
- NO_ANY_RETURN : Final = ErrorCode (
129
+ NO_ANY_RETURN : Final [ ErrorCode ] = ErrorCode (
128
130
"no-any-return" ,
129
131
'Reject returning value with "Any" type if return type is not "Any"' ,
130
132
"General" ,
131
133
)
132
- UNREACHABLE : Final = ErrorCode (
134
+ UNREACHABLE : Final [ ErrorCode ] = ErrorCode (
133
135
"unreachable" , "Warn about unreachable statements or expressions" , "General"
134
136
)
135
- REDUNDANT_EXPR : Final = ErrorCode (
137
+ REDUNDANT_EXPR : Final [ ErrorCode ] = ErrorCode (
136
138
"redundant-expr" , "Warn about redundant expressions" , "General" , default_enabled = False
137
139
)
138
140
TRUTHY_BOOL : Final [ErrorCode ] = ErrorCode (
0 commit comments