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

[LANG] No warning for unused function #4917

Merged
merged 6 commits into from
Dec 18, 2023
Merged

[LANG] No warning for unused function #4917

merged 6 commits into from
Dec 18, 2023

Conversation

Felienne
Copy link
Member

@Felienne Felienne commented Dec 17, 2023

Fixes #4911. Turns out, there were a few open issues in the unused variable warning! Calculations were not properly caught, and built-in names (like sum) were not detected. This fixes all open issues (I hope!)

How to test

I added a few new tests

@ghost
Copy link

ghost commented Dec 17, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@Felienne Felienne requested a review from jpelay December 17, 2023 20:11
@Felienne Felienne marked this pull request as ready for review December 17, 2023 20:11
Copy link
Member

@jpelay jpelay left a comment

Choose a reason for hiding this comment

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

It does indeed solve the issue! Now, while testing, I found that you can use a function that you have not defined inside a calculation:

image

When you just call it, it returns a Python error:

image

Maybe we can solve this in this PR? What do you think=

@Felienne
Copy link
Member Author

Ah good catch! I would prefer to do it in a separate PR because this PR already has quite some changes all over hedy.py so I suspect it can lead to conflicts? Can you make an issue? Thanks!!

Copy link
Contributor

mergify bot commented Dec 18, 2023

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@jpelay
Copy link
Member

jpelay commented Dec 18, 2023

Ah good catch! I would prefer to do it in a separate PR because this PR already has quite some changes all over hedy.py so I suspect it can lead to conflicts? Can you make an issue? Thanks!!

Opened #4921! 😄

@mergify mergify bot merged commit 47302d0 into main Dec 18, 2023
11 checks passed
@mergify mergify bot deleted the unused-function branch December 18, 2023 16:12
Copy link
Contributor

mergify bot commented Dec 18, 2023

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Unused variable warning when using functions
2 participants