summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authordherrada <dylan.herrada@adafruit.com>2020-07-02 11:10:43 -0400
committerdherrada <dylan.herrada@adafruit.com>2020-07-02 11:10:43 -0400
commit1e96ca582ee1d5e728dd6cd8b744a40ea1c98fe5 (patch)
treec7873db043e5bce17ddaae29b8e3ff74e2e017bd /tools
parentd1664bdde2764e1a72a792dcfb23d4b650085e97 (diff)
Made more modifications to extract_pyi.py
Diffstat (limited to 'tools')
-rw-r--r--tools/extract_pyi.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py
index 131cef15f..9d22af93a 100644
--- a/tools/extract_pyi.py
+++ b/tools/extract_pyi.py
@@ -62,10 +62,14 @@ def convert_folder(top_level, stub_directory):
print(i.__dict__['name'])
for j in i.body:
if isinstance(j, astroid.scoped_nodes.FunctionDef):
- for i in j.args.__dict__['annotations']:
- if type(i) == astroid.node_classes.Name:
- if i.name == 'Any':
+ for k, l in zip(j.args.__dict__['annotations'], j.args.__dict__['args']):
+ # K is type, l is name
+ if l.name != 'self':
+ if not k:
print(f"Missing parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n")
+ elif str(type(k)) == "<class 'astroid.node_classes.Name'>":
+ if k.name == 'Any':
+ print(f"'Any' parameter type: {j.__dict__['name']} on line {j.__dict__['lineno']}\n")
if j.returns:
if 'Any' in j.returns.__dict__.values():
print(f"Missing return type: {j.__dict__['name']} on line {j.__dict__['lineno']}")