Skip to content

add type hints to prepare.py#11

Closed
zamadye wants to merge 2 commits intoVictorVVedtion:masterfrom
zamadye:fix/type-hints-prepare
Closed

add type hints to prepare.py#11
zamadye wants to merge 2 commits intoVictorVVedtion:masterfrom
zamadye:fix/type-hints-prepare

Conversation

@zamadye
Copy link
Contributor

@zamadye zamadye commented Mar 15, 2026

added return type hints to the functions that were missing them. print_scan_report, init_ouro, and install_template all return None now.

also improved the scan_project return type from dict to dict[str, any] for better type checking.

let me know if i should add more specific types!

Copy link
Owner

@VictorVVedtion VictorVVedtion left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @zamadye! Type hints are a great improvement.

One small note: dict[str, any] uses the built-in any function, not the Any type. For correct static typing it should be:

from typing import Any

def scan_project(project_path: str) -> dict[str, Any]:

Or alternatively, since we target Python 3.10+, we could use dict[str, object] to avoid the import entirely.

The -> None additions for the other three functions are perfect — merging those as-is.

Could you update the anyAny (or object) and I'll merge? Otherwise I can fix it on my end. Either way, great first contribution!

@VictorVVedtion
Copy link
Owner

Hey @zamadye — heads up, v0.3.0 just landed on master and it modified prepare.py (template loading was refactored to support pip install distribution). This PR now has a merge conflict.

The type hint changes are still welcome! To update:

  1. Rebase on latest master: git fetch origin && git rebase origin/master
  2. Fix the anyAny issue from the earlier review
  3. The new _find_templates_dir() function added in v0.3.0 could also use a return type hint: -> str

If you'd like, you could also add type hints to the new sentinel.py module in a follow-up PR — it has similar functions that would benefit from the same treatment.

Let me know if you need help resolving the rebase conflict!

@zamadye
Copy link
Contributor Author

zamadye commented Mar 16, 2026

makasih bro! 🙏

@zamadye zamadye closed this by deleting the head repository Mar 16, 2026
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