-
-
Notifications
You must be signed in to change notification settings - Fork 236
Update pre-commit configuration #2442
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
base: main
Are you sure you want to change the base?
Conversation
Summary by CodeRabbit
WalkthroughThe PR updates pre-commit configuration to use ruff-check instead of ruff, removes a redundant import alias in the API module, and updates backend linting rules with new per-file-ignores and isort configuration settings. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
Test: This PR must be linked to an issue. |
|
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 (2)
backend/apps/api/rest/v0/__init__.py (1)
8-8: Good cleanup: removed redundant import alias.The change from
import ApiKey as ApiKeytoimport ApiKeyremoves an unnecessary alias. The symbol remains accessible under the same name with no functional impact.backend/pyproject.toml (1)
125-127: Apply isort configuration to organize existing imports.The isort configuration is well-structured:
- Correctly identifies
appsandsettingsas first-party modules- Explicitly categorizes
djangoas third-party- Follows standard Python import ordering conventions
However, existing imports in the codebase are not yet organized according to this configuration—imports are currently mixed (standard library, third-party, and first-party scattered). Run isort across the backend to enforce this new structure:
cd backend && isort .This will reorganize all imports to match your configuration automatically.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.pre-commit-config.yaml(1 hunks)backend/apps/api/rest/v0/__init__.py(1 hunks)backend/pyproject.toml(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
backend/apps/api/rest/v0/__init__.py (1)
backend/apps/api/rest/auth/api_key.py (1)
ApiKey(11-35)
🔇 Additional comments (2)
backend/pyproject.toml (1)
90-93: Appropriate ignores for Django Ninja REST API patterns.These per-file-ignores are well-justified:
- ARG001 (unused-function-argument): Django Ninja endpoints may have framework-required parameters that aren't always used in the handler body
- B008 (function-call-in-default-argument): Django Ninja's dependency injection pattern intentionally uses callables like
Query(),Body(), andPath()as default arguments.pre-commit-config.yaml (1)
15-18: Verified: ruff-check configuration is correctly set up.The config file exists at
backend/pyproject.tomlwith proper ruff configuration. The change toruff-checkaligns with modern ruff hook naming conventions, and the explicit config path is both valid and best practice.



Proposed change
Update pre-commit configuration
Checklist
make check-testlocally; all checks and tests passed.