Files
fedora-metalink-proxy/CRUSH.md
2025-10-16 19:13:53 +01:00

1.3 KiB

Fedora Metalink Proxy Codebase Guide

Build/Lint/Test Commands

  • Build: docker-compose up --build - Builds and runs the Docker container
  • Run: docker-compose up - Starts the application
  • Test: python -m unittest discover - Runs all tests (no test files found)
  • Lint: pylint app.py - Lints the main application file

Code Style Guidelines

  • Imports: Grouped by standard library, third-party, local imports
  • Formatting: 4-space indentation, spaces around operators
  • Types: Use type hints for function signatures
  • Naming: snake_case for variables/functions, CamelCase for classes
  • Error Handling: Use try/except blocks for network operations
  • Environment: Use python-dotenv for configuration
  • Logging: Use print() for debugging (consider structured logging)
  • Security: Validate all user inputs and environment variables

Project Structure

  • app.py: Main Flask application
  • templates/: HTML templates for web interface
  • data/: Persistent data directory (mounted in Docker)
  • Dockerfile: Container configuration
  • docker-compose.yml: Orchestration setup

Key Components

  • Flask web framework with Gunicorn for production
  • BeautifulSoup for XML parsing
  • Requests for HTTP operations
  • Pandas/matplotlib for statistics visualization