Files
pyMC_Repeater/.pre-commit-config.yaml
Rightup 14b4804c26 feat: Enhance logging system and introduce policy management endpoints
- Updated LogBuffer to support log entry IDs, enhanced log entry structure with additional metadata, and implemented subscriber management for real-time log streaming.
- Added OpenAPI specifications for new endpoints related to policy management, including retrieval, updating, validation, and group management for network policies.
- Implemented comprehensive tests for new policy endpoints, ensuring correct behavior for creating, updating, validating, and deleting policy groups and entries.
- Introduced policy evaluation tests to validate the functionality of the PolicyEngine, including various scenarios for action decisions based on defined rules.
- Enhanced packet routing tests to ensure proper handling of policy decisions in packet processing.
2026-06-04 15:53:17 +01:00

63 lines
1.6 KiB
YAML

# Pre-commit hooks for mc_repeater
# Install: pip install pre-commit
# Setup: pre-commit install
# Run manually: pre-commit run --all-files
default_language_version:
python: python3
repos:
# Python-focused safety checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-ast
files: ^.*\.py$
- id: debug-statements
files: ^.*\.py$
- id: check-docstring-first
files: ^.*\.py$
- id: check-builtin-literals
files: ^.*\.py$
# Modern Python linting + import sorting + formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.14
hooks:
- id: ruff-check
args: ["--fix"]
files: ^.*\.py$
- id: ruff-format
args: ["--check"]
files: ^.*\.py$
# Security-focused static analysis
- repo: https://github.com/PyCQA/bandit
rev: 1.7.9
hooks:
- id: bandit
args: ["-q", "-l", "-i"]
files: ^.*\.py$
exclude: ^tests/
# Test suite gate
- repo: local
hooks:
- id: openapi-contract-check
name: OpenAPI contract check
entry: python scripts/check_openapi_contract.py
language: python
additional_dependencies: [PyYAML]
pass_filenames: false
always_run: true
files: ^(repeater/web/.*\.py|repeater/web/openapi\.yaml)$
- id: pytest
name: pytest
entry: ./scripts/precommit-pytest.sh
language: system
pass_filenames: false
always_run: true
types: [python]