Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds line number to tracing tag of python functions to make them unique #39

Conversation

@@ -90,7 +90,11 @@ def fqn(self):
rv = self.parent.fqn() + "."
else:
rv = ""
rv += self.name
if self.location.line is not None and \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider the following refactoring:

  1. Call self.fqn once before creating Implementation, see
    l_item = Implementation(tag = Tracing_Tag("python",
  2. Find a unique name by iterating over items
  3. Don't use the line number, because this ID will be dynamic and changes if someone adds new lines to the file. Instead, use some kind of counter.

The first tag name shall always be without a number. Only the second tag name shall add a suffix.

@christophkloeffel christophkloeffel force-pushed the patch/lobster-tool-python-duplicate-function branch from 86cd606 to 331529b Compare July 29, 2024 06:39
@phiwuu phiwuu merged commit 45c34ed into bmw-software-engineering:main Jul 29, 2024
17 checks passed
@phiwuu phiwuu added the lobster-python Affects Python integration label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lobster-python Affects Python integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lobster-python: false positive on duplicate function definition Handling duplicate function definitions
2 participants