|
10 | 10 | from scripts.git_helpers import checkout_target_tag
|
11 | 11 | from scripts.paths import DRF_SOURCE_DIRECTORY, PROJECT_DIRECTORY, STUBS_DIRECTORY
|
12 | 12 |
|
13 |
| -IGNORED_MODULES = ["utils.py", "test_testing.py"] |
| 13 | +IGNORED_MODULES = [] |
14 | 14 | MOCK_OBJECTS = [
|
15 | 15 | "MockQueryset",
|
16 | 16 | "MockRequest",
|
|
40 | 40 | EXTERNAL_MODULES = ["requests"]
|
41 | 41 | IGNORED_ERRORS = {
|
42 | 42 | "__common__": [
|
43 |
| - "already defined", |
| 43 | + "already defined on line", |
44 | 44 | "Need type annotation for",
|
45 | 45 | "Cannot assign to a method",
|
46 | 46 | "Cannot determine type of",
|
47 | 47 | 'has no attribute "initkwargs"',
|
48 |
| - 'has no attribute "mapping"', |
49 | 48 | 'Response" has no attribute "view"',
|
50 | 49 | "Cannot infer type",
|
51 | 50 | ' has no attribute "_context',
|
|
74 | 73 | 'Value of type "Optional[Any]" is not indexable',
|
75 | 74 | 'Item "None" of "Optional[Any]" has no attribute',
|
76 | 75 | 'List item 0 has incompatible type "Type[',
|
77 |
| - 'error: Module has no attribute "coreapi"', |
78 | 76 | 'Value of type "Optional[str]" is not indexable',
|
79 | 77 | 'Incompatible types in assignment (expression has type "AsView[GenericView]", variable has type "AsView[Callable[[HttpRequest], Any]]")', # noqa: E501
|
80 | 78 | 'Argument "patterns" to "SchemaGenerator" has incompatible type "List[object]"',
|
|
83 | 81 | '"Module rest_framework.schemas.coreapi" does not explicitly export attribute "coreapi"',
|
84 | 82 | ],
|
85 | 83 | "browsable_api": [
|
86 |
| - '(expression has type "List[Dict[str, Dict[str, int]]]", base class "GenericAPIView" defined the type as "Union[QuerySet[_MT?], Manager[_MT?], None]")', # noqa: E501 |
87 | 84 | 'expression has type "List[Dict[str, Dict[str, int]]]"',
|
88 |
| - 'List item 0 has incompatible type "Type[IsAuthenticated]', |
89 | 85 | ],
|
90 |
| - "conftest.py": ["Unsupported operand types for"], |
91 | 86 | "models.py": ['"ForeignKeyTarget" has no attribute "sources"'],
|
92 | 87 | "serializers.pyi": [
|
93 | 88 | 'note: "IntegerSerializer" defined here',
|
|
100 | 95 | "test_bound_fields.py": ['Value of type "BoundField" is not indexable'],
|
101 | 96 | "test_decorators.py": [
|
102 | 97 | 'Argument 1 to "api_view" has incompatible type "Callable[[Any], Any]"; expected "Optional[Sequence[str]]"',
|
103 |
| - '"AsView[Callable[[Any], Any]]" has no attribute "cls"', |
104 | 98 | ],
|
105 | 99 | "test_encoders.py": ['Argument "serializer" to "ReturnList" has incompatible type "None'],
|
106 | 100 | "test_fields.py": [
|
|
116 | 110 | '"Field[Any, Any, Any, Any]" has no attribute "method_name"',
|
117 | 111 | 'Argument 1 to "ModelField" has incompatible type "None"',
|
118 | 112 | 'Argument "params" to "ValidationError" has incompatible type "Tuple[str]"',
|
119 |
| - '"MultipleChoiceField[Model]" has no attribute "partial"', |
120 | 113 | 'Argument 1 to "to_internal_value" of "Field" has incompatible type "Dict[str, str]"; expected "List[Any]"',
|
121 | 114 | 'Module "rest_framework.fields" does not explicitly export attribute "DjangoImageField"',
|
122 | 115 | 'Argument 1 to "ListField" has incompatible type "CharField"; expected "bool"',
|
123 |
| - "Possible overload variants:", |
124 |
| - "def __init__(self, *, mutable: Literal[True], query_string: Union[str, bytes, None] = ..., encoding: Optional[str] = ...) -> QueryDict", # noqa: E501 |
125 |
| - "def __init__(self, query_string: Union[str, bytes, None] = ..., mutable: bool = ..., encoding: Optional[str] = ...) -> _ImmutableQueryDict", # noqa: E501 |
126 |
| - "def __init__(self, query_string: Union[str, bytes, None], mutable: Literal[True], encoding: Optional[str] = ...) -> QueryDict", # noqa: E501 |
127 | 116 | ],
|
128 | 117 | "test_filters.py": [
|
129 | 118 | 'Module has no attribute "coreapi"',
|
|
143 | 132 | "test_middleware.py": ['"is_form_media_type" has incompatible type "Optional[str]"; expected "str"'],
|
144 | 133 | "test_model_serializer.py": [
|
145 | 134 | '"Field[Any, Any, Any, Any]" has no attribute',
|
146 |
| - 'Module has no attribute "JSONField"', |
147 |
| - 'expected "OrderedDict[Any, Any]"', |
148 | 135 | 'base class "Meta" defined the type as',
|
149 |
| - '"Field" has no attribute', |
150 |
| - '"Dict[str, Any]" has no attribute "name"', |
151 | 136 | ],
|
152 | 137 | "test_negotiation.py": ['has incompatible type "None"'],
|
153 | 138 | "test_pagination.py": [
|
154 |
| - 'Incompatible types in assignment (expression has type "None", base class "LimitOffsetPagination" defined the type as "int")', # noqa: E501 |
155 | 139 | "(not iterable)",
|
156 |
| - '(expression has type "None", variable has type "List[Any]")', |
157 | 140 | 'has incompatible type "range"',
|
158 | 141 | 'expected "Iterable[Any]"',
|
159 | 142 | ],
|
|
172 | 155 | 'Argument 2 to "re_path" has incompatible type "Callable[[], None]"; expected "Callable[..., HttpResponseBase]"', # noqa: E501
|
173 | 156 | ],
|
174 | 157 | "test_relations_pk.py": [
|
175 |
| - '"Field" has no attribute "get_queryset"', |
176 | 158 | '"OneToOneTarget" has no attribute "id"',
|
177 | 159 | '"Field[Any, Any, Any, Any]" has no attribute "get_queryset',
|
178 |
| - 'Argument "queryset" to "HyperlinkedRelatedField" has incompatible type', |
179 | 160 | ],
|
180 | 161 | "test_renderers.py": [
|
181 | 162 | '(expression has type "Callable[[], str]", variable has type "Callable[[Optional[str]], str]")'
|
182 | 163 | ],
|
183 | 164 | "test_request.py": [
|
184 | 165 | '"Request" has no attribute "inner_property"',
|
185 |
| - 'Argument 2 to "login" has incompatible type "Optional[AbstractBaseUser]"; expected "AbstractBaseUser"', |
186 | 166 | 'expression has type "Optional[AbstractBaseUser]',
|
187 | 167 | ],
|
188 | 168 | "test_response.py": [
|
|
194 | 174 | '"None" not callable',
|
195 | 175 | ],
|
196 | 176 | "test_serializer.py": [
|
197 |
| - 'of "BaseSerializer" has incompatible type "None"', |
198 | 177 | "base class",
|
199 |
| - '(expression has type "IntegerField", base class "Base" defined the type as "CharField")', |
200 | 178 | '"CharField" has incompatible type "Collection[Any]"',
|
201 | 179 | 'Name "foo" is not defined',
|
202 |
| - 'Argument "data" has incompatible type "None"', |
203 | 180 | 'Unsupported left operand type for | ("ReturnDict")',
|
204 | 181 | 'Unsupported left operand type for | ("Dict[str, str]")',
|
205 | 182 | ],
|
206 |
| - "test_serializer_bulk_update.py": [ |
207 |
| - 'Argument "data" has incompatible type "int"', |
208 |
| - 'Argument "data" has incompatible type "List[object]"', |
209 |
| - 'Argument "data" has incompatible type "List[str]"', |
210 |
| - ], |
211 | 183 | "test_serializer_lists.py": [
|
212 |
| - 'The type "Type[ListSerializer]" is not generic and not indexable', |
213 | 184 | 'Name "foo" is not defined',
|
214 | 185 | 'Unexpected keyword argument "max_length" for "IntegerSerializer"',
|
215 | 186 | 'Unexpected keyword argument "min_length" for "IntegerSerializer"',
|
|
218 | 189 | '(expression has type "NestedSerializer", base class "Field" defined the type as "bool")',
|
219 | 190 | "self.Serializer",
|
220 | 191 | '(expression has type "NonRelationalPersonDataSerializer", base class "Serializer" defined the type as "ReturnDict")', # noqa: E501
|
221 |
| - 'Argument "data" has incompatible type "None"; expected "Mapping[str, Any]"', |
222 |
| - 'Argument "data" has incompatible type "None"', |
223 | 192 | ],
|
224 | 193 | "test_settings.py": [
|
225 | 194 | 'Argument 1 to "APISettings" has incompatible type "Dict[str, int]"; expected "Optional[DefaultsSettings]'
|
226 | 195 | ],
|
227 | 196 | "test_templatetags.py": ['Module has no attribute "smart_urlquote"'],
|
| 197 | + "test_testing.py": [ |
| 198 | + '"Client" has no attribute "force_authenticate"', |
| 199 | + '"Client" has no attribute "credentials"', |
| 200 | + 'has no attribute "addClassCleanup"', |
| 201 | + ], |
228 | 202 | "test_throttling.py": [
|
229 | 203 | 'has incompatible type "Dict[<nothing>, <nothing>]"',
|
230 | 204 | '"SimpleRateThrottle" has no attribute "num_requests',
|
231 | 205 | '"SimpleRateThrottle" has no attribute "duration"',
|
232 |
| - "Cannot assign to a method", |
233 | 206 | 'Type[NonTimeThrottle]" has no attribute "called"',
|
234 | 207 | ],
|
235 | 208 | "test_utils.py": [
|
236 | 209 | "Unsupported left operand type for %",
|
237 | 210 | 'incompatible type "List[Union[URLPattern, URLResolver]]"; expected "Iterable[URLPattern]"',
|
238 | 211 | ],
|
239 | 212 | "test_validation.py": [
|
240 |
| - 'Value of type "object" is not indexable', |
241 | 213 | 'Argument 1 to "to_internal_value" of "Field" has incompatible type "object"',
|
242 |
| - 'Argument "data" to "ValidationSerializer" has incompatible type "str"; expected "Mapping[str, Any]"', |
243 |
| - 'Argument "data" to "ValidationSerializer" has incompatible type "str"', |
244 | 214 | ],
|
245 | 215 | "test_validation_error.py": [
|
246 | 216 | 'Argument "detail" to "ValidationError" has incompatible type "Tuple[str, str]"; expected "Optional[Union[str, List[Any], Dict[str, Any]]]"', # noqa: E501
|
|
253 | 223 | 'Item "GenericForeignKey" of "Union[Field[Any, Any], ForeignObjectRel, GenericForeignKey]" has no attribute "validators"', # noqa: E501
|
254 | 224 | ],
|
255 | 225 | "test_versioning.py": [
|
256 |
| - '(expression has type "Type[FakeResolverMatch]", variable has type "ResolverMatch")', |
257 | 226 | "rest_framework.decorators",
|
258 | 227 | 'Argument 1 to "include" has incompatible type "Tuple[List[object], str]"',
|
259 | 228 | ],
|
260 | 229 | "test_viewsets.py": [
|
261 |
| - '(expression has type "None", variable has type "HttpRequest")', |
262 | 230 | '(expression has type "None", variable has type "Request")',
|
263 | 231 | ],
|
| 232 | + "utils.py": ['Invalid signature "Callable[[BadType], Any]"'], |
264 | 233 | }
|
265 | 234 |
|
266 | 235 |
|
|
0 commit comments