Skip to content

Improve vulnerablecode docstring#2010

Closed
hemant-rgb wants to merge 3 commits intoaboutcode-org:mainfrom
hemant-rgb:improve-vulnerablecode-docstring
Closed

Improve vulnerablecode docstring#2010
hemant-rgb wants to merge 3 commits intoaboutcode-org:mainfrom
hemant-rgb:improve-vulnerablecode-docstring

Conversation

@hemant-rgb
Copy link
Copy Markdown

Description

Adds comprehensive type hints to all 13 functions in vulnerablecode.py for better code quality, IDE support, and maintainability.

Changes

  • Added type hints to all functions (configuration, HTTP requests, vulnerability lookups, processing)
  • Added necessary typing imports (Callable, Iterable, Any)
  • Fixed return type for bulk_search_by_purl() to correctly reflect list return
  • Added None check safety improvement in fetch_vulnerabilities()

Why

  • Improves type safety and IDE support
  • Makes code self-documenting
  • Follows Python 3.10+ modern syntax
  • No functional changes - type hints only

Testing

  • No functional changes
  • Code style compliant
  • All tests should pass

Signed-off-by: hemant-rgb <hemantmachiwar76@gmail.com>
Signed-off-by: hemant-rgb <hemantmachiwar76@gmail.com>
Signed-off-by: hemant-rgb <hemantmachiwar76@gmail.com>
@tdruez
Copy link
Copy Markdown
Contributor

tdruez commented Dec 26, 2025

These changes don't appear to be linked to any agreed-upon issues.
Structural changes to the codebase (like adding type hints) should be proposed and discussed separately before implementation. This helps us maintain consistency and ensures the team is aligned on the approach.

@tdruez tdruez closed this Dec 26, 2025
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