diff --git a/unit_static_analyser/__init__.py b/unit_static_analyser/__init__.py index ffcc44b..680693c 100644 --- a/unit_static_analyser/__init__.py +++ b/unit_static_analyser/__init__.py @@ -37,7 +37,12 @@ def run() -> None: print("Unit checking completed.") print(f"Errors: {checker.errors}") + if args.show_units: print("Units:") for key, val in checker.units.items(): - print(f"{key.fullname}: {val}") + module_name = checker.node_module_names.get(key, "") + line_number = getattr(key, "line", "") + print( + f"{key.fullname}: {val} (Module: {module_name}, Line: {line_number})" + )