From 86cd606a0d624e663c57fa298b88a11f5f2ed4a8 Mon Sep 17 00:00:00 2001 From: christophkloeffel Date: Fri, 14 Jun 2024 13:41:45 +0200 Subject: [PATCH] adds line number to tracing tag of python functions to make them unique --- lobster/tools/core/online_report.py | 1 + lobster/tools/python/python.py | 6 +++++- lobster/tools/trlc/trlc.py | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lobster/tools/core/online_report.py b/lobster/tools/core/online_report.py index 0b6afdd0..24ce9dca 100755 --- a/lobster/tools/core/online_report.py +++ b/lobster/tools/core/online_report.py @@ -122,6 +122,7 @@ def main(): rel_path_from_root = os.path.relpath(item.location.filename, repo_root) + # pylint: disable=possibly-used-before-assignment actual_repo = gh_root actual_sha = options.commit actual_path = rel_path_from_root diff --git a/lobster/tools/python/python.py b/lobster/tools/python/python.py index 5d4ffaf7..1e545f4c 100755 --- a/lobster/tools/python/python.py +++ b/lobster/tools/python/python.py @@ -90,7 +90,11 @@ def fqn(self): rv = self.parent.fqn() + "." else: rv = "" - rv += self.name + if self.location.line is not None and \ + isinstance(self, Python_Function): + rv += f"{self.name}:{str(self.location.line)}" + else: + rv += self.name return rv def lobster_tag(self): diff --git a/lobster/tools/trlc/trlc.py b/lobster/tools/trlc/trlc.py index ef9905c2..801a411c 100644 --- a/lobster/tools/trlc/trlc.py +++ b/lobster/tools/trlc/trlc.py @@ -410,6 +410,7 @@ def main(): ok = False if ok: stab = sm.process() + # pylint: disable=possibly-used-before-assignment if not ok or stab is None: print("lobster-trlc: aborting due to earlier error") return 1