Skip to content

Cursor rules: Add Cursor Rules for Development and Git Commit Standards #488

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

Merged
merged 3 commits into from
Feb 22, 2025

Conversation

tony
Copy link
Member

@tony tony commented Feb 22, 2025

Cursor rules

This PR introduces two new cursor rules to improve development workflow and commit message consistency:

1. dev-loop.mdc:

  • Establishes QA process for every code edit
  • Enforces type checking with mypy
  • Requires linting with ruff
  • Mandates test runs with pytest
  • Ensures edits are validated before committing

2. git-commits.mdc:

  • Defines structured commit message format
  • Documents commit types and their usage
  • Sets clear guidelines for message length and style
  • Provides examples of good/bad commits
  • Includes instructions for using Cursor's AI commit features

Changes

  • Added .cursor/rules/dev-loop.mdc with QA workflow
  • Added .cursor/rules/git-commits.mdc with commit standards
  • Configured globs for Python files and git-related content
  • Integrated with Cursor's AI assistance features

See also: https://docs.cursor.com/context/rules-for-ai

Note: These rules will help maintain code quality and commit history consistency across the project.

Summary by Sourcery

Adds cursor rules to enforce a QA process for code edits and standardize git commit messages.

Documentation:

  • Adds documentation for development workflow and commit message standards.
  • Documents the QA process, type checking, linting, and testing requirements for every code edit.
  • Defines a structured commit message format, including commit types, usage guidelines, and examples.

Chores:

  • Configures globs for Python files and git-related content to integrate with Cursor's AI assistance features.

tony added 2 commits February 22, 2025 11:55
why: Establish clear conventions for commit messages and AI assistance

what:
- Created git-commits.mdc with commit format guidelines
- Added commit type definitions and examples
- Included instructions for using Cursor's AI commit features
- Documented best practices for commit message structure

See also: https://docs.cursor.com/context/rules-for-ai
Copy link

sourcery-ai bot commented Feb 22, 2025

Reviewer's Guide by Sourcery

This pull request introduces two new Cursor rules: dev-loop.mdc to establish a QA process for code edits, and git-commits.mdc to define a structured commit message format. These rules aim to improve development workflow, code quality, and commit history consistency.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Introduced a new Cursor rule to establish a QA process for every code edit.
  • Established a QA process for every code edit.
  • Enforced type checking with mypy.
  • Required linting with ruff.
  • Mandated test runs with pytest.
  • Ensured edits are validated before committing.
.cursor/rules/dev-loop.mdc
Introduced a new Cursor rule to define a structured commit message format.
  • Defined a structured commit message format.
  • Documented commit types and their usage.
  • Set clear guidelines for message length and style.
  • Provided examples of good/bad commits.
  • Included instructions for using Cursor's AI commit features.
.cursor/rules/git-commits.mdc

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tony - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.09%. Comparing base (46409a6) to head (c3ec643).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #488   +/-   ##
=======================================
  Coverage   54.09%   54.09%           
=======================================
  Files          40       40           
  Lines        3627     3627           
  Branches      793      793           
=======================================
  Hits         1962     1962           
  Misses       1314     1314           
  Partials      351      351           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tony tony merged commit e3f8bee into master Feb 22, 2025
6 checks passed
@tony tony deleted the cursor-rules branch February 22, 2025 23:50
@tony tony restored the cursor-rules branch February 23, 2025 11:46
@tony tony deleted the cursor-rules branch February 23, 2025 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant