Skip to content

Conversation

@arkid15r
Copy link
Collaborator

Proposed change

Update pre-commit configuration

Checklist

  • I've read and followed the contributing guidelines.
  • I've run make check-test locally; all checks and tests passed.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 18, 2025

Summary by CodeRabbit

  • Chores
    • Updated development configuration for code quality tooling and import organization standards.
    • Refined internal import statements for consistency.

Walkthrough

The 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

Cohort / File(s) Summary
Linting and Configuration
.pre-commit-config.yaml, backend/pyproject.toml
Replaces ruff hook with ruff-check and adds --config=backend/pyproject.toml argument. Updates per-file-ignores for API routes to suppress ARG001 and B008. Introduces isort configuration with known-first-party, known-third-party, and section-order settings.
Code Updates
backend/apps/api/rest/v0/__init__.py
Removes redundant import alias for ApiKey, changing from apps.api.rest.auth.api_key import ApiKey as ApiKey to direct import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Update pre-commit configuration" directly aligns with the primary change in the changeset—the modification to .pre-commit-config.yaml that replaces the ruff hook with ruff-check and adds a --config argument. While the PR also includes secondary changes such as isort configuration in backend/pyproject.toml and an import cleanup in backend/apps/api/rest/v0/__init__.py, the title accurately reflects the main focus of the change, which centers on updating the pre-commit tooling setup. The title is clear, specific enough to understand the primary change when scanning history, and is not misleading or off-topic.
Description Check ✅ Passed The pull request description states "Update pre-commit configuration," which is related to the changeset and reflects the primary objective of the PR. While the description lacks detail and doesn't mention the supporting changes to backend/pyproject.toml (isort configuration and per-file-ignores) or the import cleanup, it is not completely unrelated or off-topic. The description accurately conveys the main purpose of the changes and is sufficiently related to at least the primary part of the changeset. The contributor has also provided a filled-out checklist indicating they followed contribution guidelines and ran local tests.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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 ark/update-pre-commit

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

Test: This PR must be linked to an issue.

@sonarqubecloud
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 ApiKey to import ApiKey removes 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 apps and settings as first-party modules
  • Explicitly categorizes django as 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

📥 Commits

Reviewing files that changed from the base of the PR and between b842459 and cee9d44.

📒 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(), and Path() 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.toml with proper ruff configuration. The change to ruff-check aligns with modern ruff hook naming conventions, and the explicit config path is both valid and best practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant