PluginBench
Rule

python github setup

via PatrickJS/awesome-cursorrules

Python development standards with GitHub integration, testing, and security best practices.

What is python github setup?

This rule establishes coding conventions and workflows for Python projects using GitHub. It enforces style guidelines (Black, Pylint, PEP 8), requires 80% test coverage with pytest, mandates security practices (input validation, environment variables), and integrates GitHub Actions for CI/CD with pull request code reviews.

  • Enforce Python naming conventions (snake_case variables/functions, PascalCase classes) and 120-character line limits with 4-space indentation
  • Require unit and integration tests with 80% coverage using pytest, plus error logging and try-catch exception handling
  • Integrate GitHub Actions CI/CD pipeline with pull request reviews covering functionality, code quality, and security
  • Enforce input validation, HTTPS, environment variable secrets management via python-dotenv, and Google-style docstrings
  • Apply Black code formatting and Pylint linting with PEP 8 compliance and Conventional Commits for version control
  • Support modular architecture following Single Responsibility and DRY principles with performance targets under 5 seconds per file

Applies to

File patterns this rule matches.

**/*
Rule definition (reference)

Source of truth, from the repository.

{ "general": { "coding_style": { "language": "Python", "use_strict": true, "indentation": "4 spaces", "max_line_length": 120, "comments": { "style": "# for single-line, ''' for multi-line", "require_comments": true } },

    "naming_conventions": {
        "variables": "snake_case",
        "functions": "snake_case",
        "classes": "PascalCase",
        "interfaces": "PascalCase",
        "files": "snake_case"
    },
    
    "error_handling": {
        "prefer_try_catch": true,
        "log_errors": true
    },
    
    "testing": {
        "require_tests": true,
        "test_coverage": "80%",
        "test_types": ["unit", "integration"]
    },
    
    "documentation": {
        "require_docs": true,
        "doc_tool": "docstrings",
        "style_guide": "Google Python Style Guide"
    },
    
    "security": {
        "require_https": true,
        "sanitize_inputs": true,
        "validate_inputs": true,
        "use_env_vars": true
    },
    
    "configuration_management": {
        "config_files": [".env"],
        "env_management": "python-dotenv",
        "secrets_management": "environment variables"
    },
    
    "code_review": {
        "require_reviews": true,
        "review_tool": "GitHub Pull Requests",
        "review_criteria": ["functionality", "code quality", "security"]
    },
    
    "version_control": {
        "system": "Git",
        "branching_strategy": "GitHub Flow",
        "commit_message_format": "Conventional Commits"
    },
    
    "logging": {
        "logging_tool": "Python logging module",
        "log_levels": ["debug", "info", "warn", "error"],
        "log_retention_policy": "7 days"
    },
    
    "monitoring": {
        "monitoring_tool": "Not specified",
        "metrics": ["file processing time", "classification accuracy", "error rate"]
    },
    
    "dependency_management": {
        "package_manager": "pip",
        "versioning_strategy": "Semantic Versioning"
    },
    
    "accessibility": {
        "standards": ["Not applicable"],
        "testing_tools": ["Not applicable"]
    },
    
    "internationalization": {
        "i18n_tool": "Not applicable",
        "supported_languages": ["English"],
        "default_language": "English"
    },
    
    "ci_cd": {
        "ci_tool": "GitHub Actions",
        "cd_tool": "Not specified",
        "pipeline_configuration": ".github/workflows/main.yml"
    },
    
    "code_formatting": {
        "formatter": "Black",
        "linting_tool": "Pylint",
        "rules": ["PEP 8", "project-specific rules"]
    },
    
    "architecture": {
        "patterns": ["Modular design"],
        "principles": ["Single Responsibility", "DRY"]
    }
},

"project_specific": {
    "use_framework": "None",
    "styling": "Not applicable",
    "testing_framework": "pytest",
    "build_tool": "setuptools",
    
    "deployment": {
        "environment": "Local machine",
        "automation": "Not specified",
        "strategy": "Manual deployment"
    },
    
    "performance": {
        "benchmarking_tool": "Not specified",
        "performance_goals": {
            "response_time": "< 5 seconds per file",
            "throughput": "Not specified",
            "error_rate": "< 1%"
        }
    }
},

"context": {
    "codebase_overview": "Python-based file organization tool using AI for content analysis and classification",
    "libraries": [
        "watchdog", "spacy", "PyPDF2", "python-docx", "pandas", "beautifulsoup4", 
        "transformers", "scikit-learn", "joblib", "python-dotenv", "torch", "pytest", 
        "shutil", "logging", "pytest-mock"
    ],
    
    "coding_practices": {
        "modularity": true,
        "DRY_principle": true,
        "performance_optimization": true
    }
},

"behavior": {
    "verbosity": {
        "level": 2,
        "range": [0, 3]
    },
    "handle_incomplete_tasks": "Provide partial solution and explain limitations",
    "ask_for_clarification": true,
    "communication_tone": "Professional and concise"
}

}

Related rules

Python LLM & ML development guide with modern tooling, type safety, and workflow best practices.

**/*
41k
via PatrickJS/awesome-cursorrules

Structured Python development guide emphasizing modular design, testing, and AI-friendly coding practices.

**/*
41k
via PatrickJS/awesome-cursorrules

PyTorch and scikit-learn for chemistry ML with best practices for molecular data.

**/*
41k
via PatrickJS/awesome-cursorrules

Standardized QA bug report template with reproduction steps and environmental context.

**/*
41k
via PatrickJS/awesome-cursorrules

TypeScript and Vite setup guide for Qwik functional component development.

**/*
41k
via PatrickJS/awesome-cursorrules

Qwik development with Tailwind CSS, TypeScript, and Vite integration.

**/*
41k
via PatrickJS/awesome-cursorrules