BernCarney bydefault .cursorrules file for Python (stars: 1)

{
  "name": "byDefault",
  "description": "A Python application with command line tools for Splunk 9.2.2 developers using UV for package and venv management, Ruff for linting and formatting, and tested with pytest.",
  "rules": [
    {
      "context": "Python CLI Development",
      "instructions": [
        "Use UV for package and venv management. Ensure package requirements and dependencies are defined in a way that supports UV.",
        "Utilize Ruff for linting and formatting. Follow PEP 8 style guidelines for Python code.",
        "Include comprehensive docstrings for all functions and classes to assure maintainability and understanding.",
        "Testing should be exclusively with pytest. Do not require unittests.",
        "Security, clarity, and maintainability must be prioritized across all development activities."
      ]
    },
    {
      "context": "Terminal Commands",
      "instructions": [
        "Always provide terminal commands in a copy-pasteable format using && for command chaining",
        "Git commands should be provided as a single line that can be directly copied to terminal",
        "Git commit messages should follow the format:",
        "  - First line: type: brief description",
        "  - Blank line",
        "  - Bullet points starting with - for detailed changes",
        "  - Optional context or rationale after bullet points only if overly complex and needed",
        "Include comments above complex commands explaining their purpose",
        "For destructive operations, include a warning comment above the command"
      ]
    },
    {
      "context": "Markdown and Documentation",
      "instructions": [
        "For README.md and other markdown files:",
        "  - Use proper heading hierarchy (# for title, ## for sections)",
        "  - For code blocks:",
        "    - Indent block markers with same level as containing section",
        "    - Indent code content one additional level inside block",
        "    - Use language identifiers (```bash, ```python)",
        "    - Keep block markers aligned with section text",
        "    - Add empty line before and after blocks",
        "  - For command examples:",
        "    - Use $ prefix for shell commands",
        "    - Include expected output indented one level",
        "    - Group related commands together",
        "    - Add descriptive text before command blocks",
        "Include clear usage instructions and examples for CLI tools.",
        "Document all major classes and functions using docstrings."
      ]
    },
    {
      "context": "CI/CD and Deployment",
      "instructions": [
        "Implement CI/CD pipelines using GitHub Actions.",
        "Ensure the project is set up for packaging and distribution as a UV tool.",
        "Deploy the package in a private enterprise GitHub repository."
      ]
    },
    {
      "context": "Python Documentation",
      "instructions": [
        "All functions and classes must have comprehensive docstrings that:",
        "  - Describe the purpose and behavior",
        "  - Document all parameters using Args section",
        "  - Document return values using Returns section",
        "  - List all raised exceptions using Raises section",
        "  - Include usage examples for complex functionality",
        "When updating code:",
        "  - Never remove existing docstrings",
        "  - Update docstrings to reflect any changes in functionality",
        "  - Add implementation details for Python version-specific features",
        "  - Document any performance considerations or optimizations"
      ]
    },
    {
      "context": "Python Development Tools",
      "instructions": [
        "Use Ruff exclusively for:",
        "  - Code formatting",
        "  - Import sorting",
        "  - Code linting",
        "  - Style enforcement",
        "Do not use or recommend:",
        "  - Pylance for linting",
        "  - Black for formatting",
        "  - isort for imports",
        "  - flake8 or pylint"
      ]
    },
    {
      "context": "Git Operations",
      "instructions": [
        "When amending commits:",
        "  - Use git add for specific files",
        "  - Use --amend to modify the last commit",
        "  - Keep the original commit message format",
        "  - Include warning about amending pushed commits",
        "Example:",
        "  git add specific/files && git commit --amend -m \"type: description",
        "",
        "  - Bullet points",
        "  - More points",
        "",
        "  Context here\""
      ]
    },
    {
      "context": "Development Notes",
      "instructions": [
        "DEVNOTES.md should include:",
        "  - Current state and recently completed work",
        "  - Next steps with implementation details",
        "  - Context for next development session",
        "  - Files of interest with brief descriptions",
        "  - Recent commits in chronological order",
        "  - Technical notes and considerations",
        "Format sections as:",
        "  ## Current State",
        "    ### Recently Completed",
        "    - List with details",
        "  ## Next Steps",
        "    - Prioritized tasks with considerations",
        "  ## Context for Next Session",
        "    - Key points for resuming work",
        "  ## Files of Interest",
        "    - Relevant files with descriptions",
        "  ## Recent Commits",
        "    - Last few commits in order",
        "  ## Notes",
        "    - Technical considerations"
      ]
    },
    {
      "context": "TODO Management",
      "instructions": [
        "Never delete tasks from TODO.md",
        "Tasks and sections should follow these rules:",
        "  - Tasks remain in their original phase and section",
        "  - Tasks can be marked complete [x] with date (YYYY-MM-DD)",
        "  - Sections can be marked as:",
        "    - (Complete) when all tasks are done",
        "    - (In Progress) when work has started",
        "    - (Next) when planned for immediate future",
        "  - New tasks can be added to any section",
        "  - Tasks can be reorganized within their section",
        "Format sections as:",
        "  ### Section Name (Complete)",
        "  - [x] Task 1 (2024-03-20)",
        "  - [x] Task 2 (2024-03-21)",
        "",
        "  ### Section Name (In Progress)",
        "  - [x] Completed task (2024-03-22)",
        "  - [ ] Current task",
        "  - [ ] Upcoming task",
        "",
        "  ### Section Name (Next)",
        "  - [ ] Planned task 1",
        "  - [ ] Planned task 2"
      ]
    }
  ]
}
python
rest-api
shell

First Time Repository

Python

Languages:

Python: 45.4KB
Shell: 3.7KB
Created: 11/6/2024
Updated: 11/29/2024

All Repositories (1)