Skip to content

Commit 787dd9e

Browse files
authored
ci: Fix interface scan omits types (e.g., ConnectorResourceReference) (#2880)
1 parent 1361032 commit 787dd9e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bin/public_interface.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def _scan_variables_in_module(self, module_name: str) -> None:
5151
There is no method to verify if a module attribute is a constant,
5252
After some experiment, here we assume if an attribute is a value
5353
(without `__module__`) and not a module itself is a constant.
54+
55+
Note: Class (and other types) should be treated as a variable too
5456
"""
5557
for constant_name, _ in inspect.getmembers(
5658
importlib.import_module(module_name),
@@ -61,6 +63,13 @@ def _scan_variables_in_module(self, module_name: str) -> None:
6163
full_path = f"{module_name}.{constant_name}"
6264
self.variables.add(full_path)
6365

66+
for class_name, _class in inspect.getmembers(importlib.import_module(module_name), inspect.isclass):
67+
# Skip imported and ones starting with "_"
68+
if _class.__module__ != module_name or class_name.startswith("_"):
69+
continue
70+
full_path = f"{module_name}.{class_name}"
71+
self.variables.add(full_path)
72+
6473
def _scan_classes_in_module(self, module_name: str) -> None:
6574
for class_name, _class in inspect.getmembers(importlib.import_module(module_name), inspect.isclass):
6675
# Skip imported and ones starting with "_"

0 commit comments

Comments
 (0)