-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Refactor Python cursor rules for clarity and consistency #138
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
Conversation
Consolidate best practices for Python development and AI-friendly coding.
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
🧹 Nitpick comments (2)
rules/python-cursorrules-prompt-file-best-practices/.cursorrules (2)
3-11: Tighten tooling guidance (uv, Ruff) for precision and applicability.Minor wording tweaks will better reflect recommended usage and reduce ambiguity (uv manages pyproject/venv/lock; Ruff can be both linter and formatter).
- - Dependency management via https://github.com/astral-sh/uv and virtual environments. - - Code style consistency using Ruff. + - Dependency and environment management via uv (pyproject.toml + uv lock/venv). + - Code style with Ruff (enable ruff lint and ruff format).Optional: consider noting “pyproject.toml-first” layout and pinning Python versions in CI matrices.
14-14: Rephrase AI-facing sentence for consistency and neutral voice.Keeps tone consistent with the rest of the rules and avoids second-person phrasing.
- - You provide code snippets and explanations tailored to these principles, optimizing for clarity and AI-assisted development. + - Provide code snippets and explanations aligned with these principles, optimized for clarity and AI-assisted development.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
rules/python-cursorrules-prompt-file-best-practices/.cursorrules(1 hunks)
🔇 Additional comments (1)
rules/python-cursorrules-prompt-file-best-practices/.cursorrules (1)
22-29: Add TYPE_CHECKING guard around type-only imports and verify fixture pathsPlease ensure you:
- Import
TYPE_CHECKINGand wrap all private‐module and plugin type imports in anif TYPE_CHECKING:block to avoid pulling in_pytestinternals at runtime.- Prefer public exports when they exist (for example,
pytest.MonkeyPatch) and only fall back to_pytest.*if no public alias is available.- Manually confirm that for your supported pytest version(s) (e.g. 7.x) and pytest-mock version, the typing import paths for these fixtures are correct:
- CaptureFixture
- FixtureRequest
- LogCaptureFixture
- MonkeyPatch
- MockerFixture
Example update:
from typing import TYPE_CHECKING if TYPE_CHECKING: # Verify these paths against your pytest and pytest-mock versions from _pytest.capture import CaptureFixture from _pytest.fixtures import FixtureRequest from _pytest.logging import LogCaptureFixture from _pytest.monkeypatch import MonkeyPatch from pytest_mock.plugin import MockerFixturePlease double-check the latest recommended import paths in the pytest and pytest-mock documentation to ensure your type annotations remain accurate.
rules/python-cursorrules-prompt-file-best-practices/.cursorrules
Outdated
Show resolved
Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Consolidate best practices for Python development and AI-friendly coding.
Summary by CodeRabbit