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

Start with python match statement #1801

Merged
merged 23 commits into from
Nov 21, 2024
Merged

Start with python match statement #1801

merged 23 commits into from
Nov 21, 2024

Conversation

KuechA
Copy link
Contributor

@KuechA KuechA commented Oct 21, 2024

This PR adds the basic comparisons which can be found in python's match statement. The statement is modeled as a SwitchStatement and the main issue are the CaseStatements which offer a wide range of checks, some of which we cannot model trivially.

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 86.81319% with 12 lines in your changes missing coverage. Please review.

Project coverage is 76.19%. Comparing base (37987af) to head (947ad17).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...fer/aisec/cpg/frontends/python/StatementHandler.kt 84.72% 6 Missing and 5 partials ⚠️
...er/aisec/cpg/frontends/python/ExpressionHandler.kt 94.44% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...ofer/aisec/cpg/graph/statements/SwitchStatement.kt 72.00% <ø> (ø)
...de/fraunhofer/aisec/cpg/frontends/python/Python.kt 83.38% <100.00%> (+8.77%) ⬆️
...er/aisec/cpg/frontends/python/ExpressionHandler.kt 75.27% <94.44%> (+0.18%) ⬆️
...fer/aisec/cpg/frontends/python/StatementHandler.kt 84.61% <84.72%> (+0.55%) ⬆️

... and 1 file with indirect coverage changes

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


🚨 Try these New Features:

@KuechA KuechA enabled auto-merge (squash) October 31, 2024 10:06
Copy link
Contributor

@maximiliankaul maximiliankaul left a comment

Choose a reason for hiding this comment

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

Overall, I like this very much.
Some more nitpicking comments, but I think this is good to be merged :)
We should open an issue to track the not implemented cases...

KuechA and others added 2 commits November 14, 2024 10:26
…ontends/python/StatementHandler.kt

Co-authored-by: Maximilian Kaul <[email protected]>
@KuechA KuechA merged commit 2b0474a into main Nov 21, 2024
2 checks passed
@KuechA KuechA deleted the ak/python-match branch November 21, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants