Skip to content

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

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 2 commits into from
Feb 23, 2025

Conversation

tony
Copy link
Member

@tony tony commented Feb 23, 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.

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, including QA process, type checking, linting, and testing requirements.
  • 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 23, 2025 05:44
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 23, 2025

Reviewer's Guide by Sourcery

This pull request introduces two new cursor rules: one to enforce a QA process for code edits and another to standardize git commit messages. The rules are implemented as markdown files within the .cursor/rules directory.

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 standardize git commit messages.
  • 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

codecov bot commented Feb 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.80%. Comparing base (6236cbe) to head (30edca2).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #575   +/-   ##
=======================================
  Coverage   88.80%   88.80%           
=======================================
  Files          36       36           
  Lines        4075     4075           
  Branches      385      385           
=======================================
  Hits         3619     3619           
  Misses        308      308           
  Partials      148      148           

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

@tony tony marked this pull request as ready for review February 23, 2025 11:46
@tony tony merged commit 64658ce into master Feb 23, 2025
25 checks passed
@tony tony deleted the cursor-rules branch February 23, 2025 11:47
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