File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Run with 'python tools/extract_pyi.py shared-bindings/ path/to/stub/dir
2+ # You can also test a specific library in shared-bindings by putting the path
3+ # to that directory instead
4+
15import os
26import sys
37import astroid
@@ -58,8 +62,10 @@ def convert_folder(top_level, stub_directory):
5862 print (i .__dict__ ['name' ])
5963 for j in i .body :
6064 if isinstance (j , astroid .scoped_nodes .FunctionDef ):
61- if None in j .args .__dict__ ['annotations' ]:
62- print (f"Missing parameter type: { j .__dict__ ['name' ]} on line { j .__dict__ ['lineno' ]} \n " )
65+ for i in j .args .__dict__ ['annotations' ]:
66+ if type (i ) == astroid .node_classes .Name :
67+ if i .name == 'Any' :
68+ print (f"Missing parameter type: { j .__dict__ ['name' ]} on line { j .__dict__ ['lineno' ]} \n " )
6369 if j .returns :
6470 if 'Any' in j .returns .__dict__ .values ():
6571 print (f"Missing return type: { j .__dict__ ['name' ]} on line { j .__dict__ ['lineno' ]} " )
You can’t perform that action at this time.
0 commit comments