Skip to content

ci: cursor rules for consistent quality docstring production #7316

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .cursor/rules/docs.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
description:
globs:
alwaysApply: true
---
# Docstring Style Guide

All functions, methods, and classes must be documented using Google-style docstrings.

## Required Format

```python
def function_name(param1: type, param2: type) -> type:
"""
Brief summary of what the function does in one line.

More detailed explanation if needed.

Args:
param1 (type): Description of param1.
Include details on multiple lines if needed.
param2 (type, optional): Description of param2. Default is None.

Returns:
return_type: Description of the return value.

Raises:
ExceptionType: When and why this exception is raised.
""" # noqa: E501
```
_Note: Inclide ` # noqa: E501` to avoid conflicts with CI._

## Section Guidelines

1. Start with a brief one-line summary
2. Follow with a more detailed explanation if needed (separated by blank line)
3. Use the following sections as needed:
- `Args:` - For function/method parameters
- `Returns:` - For return values
- `Raises:` - For exceptions
- `Attributes:` - For class attributes
- `Examples:` - For usage examples

## Parameter Documentation
- Format: `param_name (type): Description`
- Include default values in the description: `(type, optional): Description. Default is value.`
- Indent continuation lines with 4 spaces

## Types
- Use Python type annotations in function signatures
- Use descriptive types in docstrings (`dict` instead of `Dict`, etc.)
- For unions use `type1 or type2`
Loading