Spaces:
Sleeping
Sleeping
Create .pre-commit-config.yaml
Browse files- .pre-commit-config.yaml +72 -0
.pre-commit-config.yaml
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pre-commit hooks for AI Agency Pro
|
| 2 |
+
# Install: pip install pre-commit && pre-commit install
|
| 3 |
+
# Run manually: pre-commit run --all-files
|
| 4 |
+
|
| 5 |
+
default_language_version:
|
| 6 |
+
python: python3.11
|
| 7 |
+
|
| 8 |
+
repos:
|
| 9 |
+
# General file checks
|
| 10 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
| 11 |
+
rev: v4.5.0
|
| 12 |
+
hooks:
|
| 13 |
+
- id: trailing-whitespace
|
| 14 |
+
- id: end-of-file-fixer
|
| 15 |
+
- id: check-yaml
|
| 16 |
+
args: [--unsafe]
|
| 17 |
+
- id: check-json
|
| 18 |
+
- id: check-added-large-files
|
| 19 |
+
args: ['--maxkb=1000']
|
| 20 |
+
- id: check-merge-conflict
|
| 21 |
+
- id: detect-private-key
|
| 22 |
+
- id: check-case-conflict
|
| 23 |
+
|
| 24 |
+
# Python code formatting with Black
|
| 25 |
+
- repo: https://github.com/psf/black
|
| 26 |
+
rev: 24.3.0
|
| 27 |
+
hooks:
|
| 28 |
+
- id: black
|
| 29 |
+
language_version: python3.11
|
| 30 |
+
args: ['--line-length=127']
|
| 31 |
+
|
| 32 |
+
# Import sorting with isort
|
| 33 |
+
- repo: https://github.com/pycqa/isort
|
| 34 |
+
rev: 5.13.2
|
| 35 |
+
hooks:
|
| 36 |
+
- id: isort
|
| 37 |
+
args: ['--profile=black', '--line-length=127']
|
| 38 |
+
|
| 39 |
+
# Linting with flake8
|
| 40 |
+
- repo: https://github.com/pycqa/flake8
|
| 41 |
+
rev: 7.0.0
|
| 42 |
+
hooks:
|
| 43 |
+
- id: flake8
|
| 44 |
+
args: ['--max-line-length=127', '--ignore=E501,W503']
|
| 45 |
+
additional_dependencies:
|
| 46 |
+
- flake8-docstrings
|
| 47 |
+
- flake8-bugbear
|
| 48 |
+
|
| 49 |
+
# Type checking with mypy (optional)
|
| 50 |
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
| 51 |
+
rev: v1.9.0
|
| 52 |
+
hooks:
|
| 53 |
+
- id: mypy
|
| 54 |
+
args: ['--ignore-missing-imports', '--no-strict-optional']
|
| 55 |
+
additional_dependencies:
|
| 56 |
+
- types-requests
|
| 57 |
+
- types-PyYAML
|
| 58 |
+
|
| 59 |
+
# Security checks with bandit
|
| 60 |
+
- repo: https://github.com/PyCQA/bandit
|
| 61 |
+
rev: 1.7.8
|
| 62 |
+
hooks:
|
| 63 |
+
- id: bandit
|
| 64 |
+
args: ['-ll', '-ii']
|
| 65 |
+
exclude: tests/
|
| 66 |
+
|
| 67 |
+
# Markdown linting
|
| 68 |
+
- repo: https://github.com/igorshubovych/markdownlint-cli
|
| 69 |
+
rev: v0.39.0
|
| 70 |
+
hooks:
|
| 71 |
+
- id: markdownlint
|
| 72 |
+
args: ['--fix', '--disable', 'MD013', 'MD033', 'MD041']
|