-
Notifications
You must be signed in to change notification settings - Fork 6
Fix return types #541
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
Fix return types #541
Conversation
Walkthrough
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying infrahub-sdk-python with
|
| Latest commit: |
90f7be1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7b614792.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://pog-test-return-types.infrahub-sdk-python.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## develop #541 +/- ##
===========================================
- Coverage 75.94% 75.84% -0.11%
===========================================
Files 100 100
Lines 9329 8868 -461
Branches 1832 1737 -95
===========================================
- Hits 7085 6726 -359
+ Misses 1754 1668 -86
+ Partials 490 474 -16
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/unit/sdk/test_repository.py (1)
53-55: **Return type added correctly; optional: type *args/kwargs to drop noqa.
-> Noneis correct for the sentinel stub. If you want to avoid# noqa: ANN002, ANN003, annotate the variadics:- def mock_init(*args, **kwargs) -> None: # noqa: ANN002, ANN003 + def mock_init(*args: Any, **kwargs: Any) -> None:And add:
from typing import Any
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
pyproject.toml(0 hunks)tests/unit/sdk/checks/test_checks.py(1 hunks)tests/unit/sdk/test_repository.py(1 hunks)
💤 Files with no reviewable changes (1)
- pyproject.toml
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
When implementing Infrahub checks, subclass InfrahubCheck and override validate(data); do not implement or rely on a check() method
Files:
tests/unit/sdk/test_repository.pytests/unit/sdk/checks/test_checks.py
tests/unit/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Place and write unit tests under tests/unit/ (isolated component tests)
Files:
tests/unit/sdk/test_repository.pytests/unit/sdk/checks/test_checks.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Use the custom pytest plugin (infrahub_sdk.pytest_plugin) fixtures for clients, configuration, and Infrahub-specific testing
Files:
tests/unit/sdk/test_repository.pytests/unit/sdk/checks/test_checks.py
🧠 Learnings (1)
📚 Learning: 2025-08-24T13:35:12.998Z
Learnt from: CR
PR: opsmill/infrahub-sdk-python#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-24T13:35:12.998Z
Learning: Applies to **/*.py : When implementing Infrahub checks, subclass InfrahubCheck and override validate(data); do not implement or rely on a check() method
Applied to files:
tests/unit/sdk/checks/test_checks.py
🧬 Code graph analysis (1)
tests/unit/sdk/checks/test_checks.py (1)
infrahub_sdk/checks.py (1)
InfrahubCheck(33-175)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: unit-tests (3.13)
- GitHub Check: unit-tests (3.12)
- GitHub Check: unit-tests (3.10)
- GitHub Check: integration-tests-latest-infrahub
🔇 Additional comments (2)
tests/unit/sdk/checks/test_checks.py (2)
49-51: Async validate return type matches base signature.
async def validate(... ) -> Nonealigns with InfrahubCheck.validate and project guidelines. LGTM.
55-57: Sync validate return type matches base signature.
def validate(... ) -> Noneis consistent and correct. LGTM.
Summary by CodeRabbit