chore: integrate @tanstack/eslint-plugin-query and fix service layer lint errors#75
Open
Conversation
Greptile SummaryThis PR integrates Key Changes:
Issues Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant ESLint as ESLint Config
participant TQ as @tanstack/eslint-plugin-query
participant Services as Service Layer Files
participant Queries as React Query Hooks
Dev->>ESLint: Add @tanstack/eslint-plugin-query
ESLint->>TQ: Load flat/recommended config
TQ->>Services: Scan for query hook violations
Services->>TQ: Check queryKey dependencies
TQ-->>Services: Report missing dependencies in queryKeys
Dev->>Services: Fix queryKey to include all dependencies
Note over Services: access-control.ts, use-models.ts,<br/>use-document.ts, use-segment.ts,<br/>use-pipeline.ts, use-plugins.ts,<br/>goto-anything/index.tsx
Services->>Queries: Updated queryKeys with proper deps
Note over Queries: Ensures cache invalidation<br/>works correctly when deps change
Dev->>Services: Refactor useModelInList
Note over Services: Extract primitive provider<br/>value for stable queryKey
|
Comment on lines
+234
to
+235
| self, tenant_id: str, provider: str, model_type: str, model, credential_id: str | None | ||
| ): |
There was a problem hiding this comment.
style: Type annotations removed violate the Python style guide in AGENTS.md which states "Keep type hints on functions and attributes". The model parameter should be typed as str and the return type should be -> dict | None
Suggested change
| self, tenant_id: str, provider: str, model_type: str, model, credential_id: str | None | |
| ): | |
| def get_model_credential( | |
| self, tenant_id: str, provider: str, model_type: str, model: str, credential_id: str | None | |
| ) -> dict | None: |
Context Used: Context from dashboard - CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: api/services/model_provider_service.py
Line: 234:235
Comment:
**style:** Type annotations removed violate the Python style guide in AGENTS.md which states "Keep type hints on functions and attributes". The `model` parameter should be typed as `str` and the return type should be `-> dict | None`
```suggestion
def get_model_credential(
self, tenant_id: str, provider: str, model_type: str, model: str, credential_id: str | None
) -> dict | None:
```
**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=a5f96311-5bd1-49f2-9828-2ee0c089c012))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Benchmark PR from qodo-benchmark#263