@@ -206,12 +206,17 @@ def add_error_info(self, info: ErrorInfo) -> None:
206
206
207
207
def generate_unused_ignore_notes (self ) -> None :
208
208
for file , ignored_lines in self .ignored_lines .items ():
209
- for line in ignored_lines - self .used_ignored_lines [file ]:
210
- # Don't use report since add_error_info will ignore the error!
211
- info = ErrorInfo (self .import_context (), file , None , None ,
212
- line , 'note' , "unused 'type: ignore' comment" ,
213
- False , False )
214
- self .error_info .append (info )
209
+ if not self .is_typeshed_file (file ):
210
+ for line in ignored_lines - self .used_ignored_lines [file ]:
211
+ # Don't use report since add_error_info will ignore the error!
212
+ info = ErrorInfo (self .import_context (), file , None , None ,
213
+ line , 'note' , "unused 'type: ignore' comment" ,
214
+ False , False )
215
+ self .error_info .append (info )
216
+
217
+ def is_typeshed_file (self , file : str ) -> bool :
218
+ # gross, but no other clear way to tell
219
+ return 'typeshed' in os .path .normpath (file ).split (os .sep )
215
220
216
221
def num_messages (self ) -> int :
217
222
"""Return the number of generated messages."""
0 commit comments