Skip to content

Commit

Permalink
Disable note: messages (#35)
Browse files Browse the repository at this point in the history
* add global note: ignore
  • Loading branch information
mkurnikov authored Mar 1, 2019
1 parent 18445f6 commit 9e4ed70
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/typecheck_tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import itertools
import os
import re
import sys
Expand Down Expand Up @@ -58,6 +59,7 @@
'Argument 1 to "loads" has incompatible type "Union[bytes, str, None]"; '
+ 'expected "Union[str, bytes, bytearray]"',
'Incompatible types in assignment (expression has type "None", variable has type Module)',
'note:'
],
'admin_changelist': [
'Incompatible types in assignment (expression has type "FilteredChildAdmin", variable has type "ChildAdmin")'
Expand Down Expand Up @@ -193,7 +195,7 @@
'Incompatible types in assignment (expression has type "TestForm", variable has type "Person")',
'Incompatible types in assignment (expression has type "Type[Textarea]", '
+ 'base class "Field" defined the type as "Widget")',
'Incompatible types in assignment (expression has type "SimpleUploadedFile", variable has type "BinaryIO")'
'Incompatible types in assignment (expression has type "SimpleUploadedFile", variable has type "BinaryIO")',
],
'get_object_or_404': [
'Argument 1 to "get_object_or_404" has incompatible type "str"; '
Expand Down Expand Up @@ -642,7 +644,8 @@ def cd(path):


def is_ignored(line: str, test_folder_name: str) -> bool:
for pattern in IGNORED_ERRORS['__common__'] + IGNORED_ERRORS.get(test_folder_name, []):
for pattern in itertools.chain(IGNORED_ERRORS['__common__'],
IGNORED_ERRORS.get(test_folder_name, [])):
if isinstance(pattern, Pattern):
if pattern.search(line):
return True
Expand Down

0 comments on commit 9e4ed70

Please sign in to comment.