# Performance Rules Configuration
# ================================
# Performance-focused validation rules for the codebase.
# Run with: python scripts/validate/validate_performance.py

version: "1.0"
project: "letzshop-product-import"

description: |
  Performance validation rules to detect inefficient patterns and ensure
  optimal performance across the application.

principles:
  - name: "Minimize Database Queries"
    description: "Reduce N+1 queries and optimize data fetching"
  - name: "Efficient Data Structures"
    description: "Use appropriate data structures for the task"
  - name: "Lazy Loading"
    description: "Load data only when needed"
  - name: "Caching Strategy"
    description: "Cache expensive computations and frequent queries"
  - name: "Async I/O"
    description: "Use async for I/O-bound operations"

includes:
  - database.yaml
  - caching.yaml
  - api.yaml
  - async.yaml
  - memory.yaml
  - frontend.yaml

severity_levels:
  error:
    description: "Critical performance issue that must be fixed"
    exit_code: 1
  warning:
    description: "Performance concern that should be addressed"
    exit_code: 0
  info:
    description: "Performance optimization recommendation"
    exit_code: 0

ignore:
  files:
    - "**/test_*.py"
    - "**/tests/**"
    - "**/*_test.py"
    - "**/conftest.py"
    - "**/migrations/**"
    - "**/.venv/**"
    - "**/venv/**"
    - "**/node_modules/**"
    - "**/site/**"
    - "**/scripts/**"
    - "**/__pycache__/**"
    - "**/*.pyc"
  patterns:
    # Allow patterns in test files
    - file: "**/tests/**"
      pattern: ".*"
      reason: "Test files may have different performance requirements"
    # Allow patterns in scripts
    - file: "**/scripts/**"
      pattern: "\\.all\\(\\)"
      reason: "Scripts may need to process all records"
