Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixing issues with inferring field declarations instead of variables in Python #1977

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

KuechA
Copy link
Contributor

@KuechA KuechA commented Jan 24, 2025

Whenever we're in a class, the PythonAddDeclarationsPass infers a FieldDeclaration even if we're in a method and do not have a MemberExpression where the base is the method's receiver. We probably want to have local variables in this case. This PR addresses this issue and thus fixes #1975

@KuechA KuechA linked an issue Jan 24, 2025 that may be closed by this pull request
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.99%. Comparing base (81b9939) to head (7a37612).
Report is 1 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
...ofer/aisec/cpg/passes/PythonAddDeclarationsPass.kt 90.41% <100.00%> (+0.41%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KuechA KuechA marked this pull request as ready for review January 24, 2025 15:46
@KuechA KuechA added the publish-to-github-packages If added to a PR, builds from it will be published as a GitHub package label Jan 24, 2025
@oxisto oxisto changed the title Try to fix 1975 Fixing issues with inferring field declarations instead of variables in Python Jan 24, 2025
@oxisto oxisto added the python label Jan 24, 2025
@oxisto oxisto enabled auto-merge (squash) January 24, 2025 20:28
@oxisto oxisto removed the publish-to-github-packages If added to a PR, builds from it will be published as a GitHub package label Jan 24, 2025
@oxisto oxisto merged commit d0d7243 into main Jan 24, 2025
4 checks passed
@oxisto oxisto deleted the ak/fix1975 branch January 24, 2025 20:53
@KuechA KuechA self-assigned this Jan 27, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PythonAddDeclarationsPass always infers FieldDeclarations in a method
2 participants