You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request refines type checking and linting configurations across the codebase. Changes include narrowing generic type ignore comments to specific ignore codes (such as return-value, union-attr, and attr-defined) in multiple files to improve static type analysis precision. In infrahub_sdk/query_groups.py, the unused_member_ids variable is converted from a set to a list structure while preserving semantic content. The Ruff configuration in pyproject.toml removes the "PGH" rule from the ignore list. A test expectation comment is updated for consistency in formatting style.
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
⚠️ Warning
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.
You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name
Status
Explanation
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
✅ Passed
The title 'Use specific rule codes when using noqa' directly aligns with the primary objective of the PR, which is to use specific ignore types instead of generic ignores across the codebase.
✨ Finishing touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
Create PR with unit tests
Post copyable unit tests in a comment
Commit unit tests in branch pog-pygrep-hooks
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 21d565e and 3cf549f.
⏰ 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). (1)
GitHub Check: Cloudflare Pages
🔇 Additional comments (8)
tests/integration/conftest.py (1)
251-251: LGTM – cleanup of commented code.
This line is entirely commented out (inside a commented fixture), so removing the type ignore directive has no functional impact. The change aligns with the PR's goal of cleaning up type annotations.
tests/unit/sdk/conftest.py (1)
177-177: LGTM – improved type checking.
Removing the generic # type: ignore directives from these NodeSchema(**data).convert_api() calls indicates that the type checker now properly infers the return types. This tightens type checking without any functional changes.
Also applies to: 219-219, 284-284, 298-298, 682-682, 896-896, 920-920, 944-944, 957-957, 989-989, 1109-1109, 1168-1168, 1277-1277, 1451-1451
tests/__init__.py (1)
6-7: LGTM – more precise type ignores.
Narrowing the generic # type: ignore to specific # type: ignore[attr-defined] is best practice. It clearly documents that the ignore is needed because attributes are being dynamically added to the builtins module.
infrahub_sdk/config.py (1)
176-176: LGTM – narrowed type ignore.
Specifying # type: ignore[return-value] instead of a generic ignore makes the suppression more precise and maintainable. The comment above provides clear context for why the ignore is necessary.
tests/unit/sdk/test_template.py (1)
223-223: LGTM – standardized noqa format.
The change from # noqa E501 to # noqa: E501 adopts the standard format with a colon. The test expectation correctly reflects this formatting improvement.
tests/unit/__init__.py (1)
5-5: LGTM – specific type ignore.
Using # type: ignore[attr-defined] instead of a generic ignore clearly documents why the suppression is needed for this dynamic attribute assignment on the builtins module.
infrahub_sdk/query_groups.py (2)
171-171: LGTM – corrected type mismatch.
The change from set(...) - set(...) to list(set(...) - set(...)) correctly aligns with the type annotation unused_member_ids: list[str] | None at line 22. The narrowed # type: ignore[union-attr] is also more precise.
Note: Membership testing (member.id in self.unused_member_ids at line 111) becomes O(n) with a list vs O(1) with a set, but this is unlikely to be a concern given the expected small collection sizes.
265-265: LGTM – corrected type mismatch (sync version).
Same as the async version at line 171: correctly converts the set difference to a list to match the type annotation, and uses a more specific type ignore directive.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use specific ignore types where applicable instead of ignoring everything.
Summary by CodeRabbit
Refactor
Chores