Skip to content

fix(python/sast): Populate ReturnType and MethodArgumentsType for Python functions - #513

Merged
shivasurya merged 1 commit into
mainfrom
fix/python-return-type-and-parameters
Feb 9, 2026
Merged

shivasurya merged 1 commit into
mainfrom
fix/python-return-type-and-parameters

Conversation

@shivasurya

Copy link
Copy Markdown
Owner

Summary

  • Extract return_type annotation (e.g., -> int) from Python function definitions via tree-sitter ChildByFieldName("return_type")
  • Extract typed parameter annotations into MethodArgumentsType in name: type format from typed_parameter and typed_default_parameter nodes
  • Also handle typed_default_parameter in MethodArgumentsValue (was previously skipped)

Test plan

  • 22 new sub-tests covering return types, typed params, untyped params, *args/**kwargs, defaults
  • End-to-end test through buildGraphFromAST verifying functions, methods, constructors, properties, special methods
  • All existing tests pass (gradle buildGo testGo lintGo)

🤖 Generated with Claude Code

…hon functions

Python parser now extracts return type annotations and typed parameter
info from function definitions, matching the Java parser's behavior.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@shivasurya shivasurya added bug Something isn't working go Pull requests that update go code labels Feb 9, 2026
@shivasurya shivasurya self-assigned this Feb 9, 2026
@safedep

safedep Bot commented Feb 9, 2026 •

Copy link
Copy Markdown

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@github-actions

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown

Code Pathfinder Security Scan

Pass Critical High Medium Low Info

No security issues detected.

Metric Value
Files Scanned 2
Rules 38

Powered by Code Pathfinder

@codecov

codecov Bot commented Feb 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.52%. Comparing base (9eb3879) to head (afddfc6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #513      +/-   ##
==========================================
+ Coverage   82.48%   82.52%   +0.03%     
==========================================
  Files         122      122              
  Lines       14025    14041      +16     
==========================================
+ Hits        11569    11587      +18     
+ Misses       2013     2012       -1     
+ Partials      443      442       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shivasurya
shivasurya merged commit d32c405 into main Feb 9, 2026
7 checks passed
@shivasurya
shivasurya deleted the fix/python-return-type-and-parameters branch February 9, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant