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

[K9VULN-2347] Implement test file detection for Python #583

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

jasonforal
Copy link
Collaborator

@jasonforal jasonforal commented Dec 18, 2024

What problem are you trying to solve?

The analyzer doesn't accurately classify Python files that contain or are related to tests.

What is your solution?

  • Implement a parser for Python package imports. (Language reference here)
  • Add detections for common Python test packages (here).
  • Add file-path detections for common Python test packages (here)

Alternatives considered

What the reviewer should know

@jasonforal jasonforal requested a review from amaanq December 18, 2024 15:52
@jasonforal jasonforal requested a review from a team as a code owner December 18, 2024 15:52
@amaanq
Copy link
Collaborator

amaanq commented Dec 18, 2024

Is the CI failure here expected?

@jasonforal
Copy link
Collaborator Author

No, good catch -- that's definitely a bug. I'll fix that

@amaanq
Copy link
Collaborator

amaanq commented Dec 18, 2024

After a quick check, it seems like this issue is caused by the from . import <name> syntax

@jasonforal jasonforal merged commit bce3e2d into main Dec 19, 2024
71 checks passed
@jasonforal jasonforal deleted the jf/K9VULN-2347 branch December 19, 2024 18:31
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.

2 participants