File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,22 @@ def convert_folder(top_level, stub_directory):
52
52
# Validate that the module is a parseable stub.
53
53
total += 1
54
54
try :
55
- astroid .parse (stub_contents )
55
+ tree = astroid .parse (stub_contents )
56
+ for i in tree .body :
57
+ if 'name' in i .__dict__ :
58
+ print (i .__dict__ ['name' ])
59
+ for j in i .body :
60
+ 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 " )
63
+ if j .returns :
64
+ if 'Any' in j .returns .__dict__ .values ():
65
+ print (f"Missing return type: { j .__dict__ ['name' ]} on line { j .__dict__ ['lineno' ]} " )
66
+ elif isinstance (j , astroid .node_classes .AnnAssign ):
67
+ if 'name' in j .__dict__ ['annotation' ].__dict__ :
68
+ if j .__dict__ ['annotation' ].__dict__ ['name' ] == 'Any' :
69
+ print (f"missing attribute type on line { j .__dict__ ['lineno' ]} " )
70
+
56
71
ok += 1
57
72
except astroid .exceptions .AstroidSyntaxError as e :
58
73
e = e .__cause__
You can’t perform that action at this time.
0 commit comments