forked from ShaerWare/AI_Secretary_System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
102 lines (95 loc) · 3.73 KB
/
.pre-commit-config.yaml
File metadata and controls
102 lines (95 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# =============================================================================
# AI Secretary System - Pre-commit Hooks
# =============================================================================
#
# Installation:
# pip install pre-commit
# pre-commit install
#
# Manual run:
# pre-commit run --all-files
#
# =============================================================================
repos:
# ---------------------------------------------------------------------------
# General
# ---------------------------------------------------------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: ^(admin/dist/|web-widget/dist/)
- id: end-of-file-fixer
exclude: ^(admin/dist/|web-widget/dist/)
- id: check-yaml
args: [--unsafe] # Allow custom tags in docker-compose
- id: check-json
exclude: ^(admin/node_modules/|package-lock\.json)
- id: check-toml
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: detect-private-key
# ---------------------------------------------------------------------------
# Python - Ruff (Linter + Formatter)
# ---------------------------------------------------------------------------
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
exclude: ^(admin/|finetune/datasets/|models/)
- id: ruff-format
exclude: ^(admin/|finetune/datasets/|models/)
# ---------------------------------------------------------------------------
# Python - MyPy (Type Checking)
# ---------------------------------------------------------------------------
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
additional_dependencies:
- types-redis
- types-aiofiles
- sqlalchemy[mypy]
exclude: ^(admin/|finetune/|tests/|models/)
# Only run on core modules for now
files: ^(db/|auth_manager\.py|service_manager\.py)
# ---------------------------------------------------------------------------
# JavaScript/TypeScript/Vue - ESLint + Prettier
# ---------------------------------------------------------------------------
- repo: local
hooks:
- id: eslint
name: eslint
entry: bash -c 'cd admin && npm run lint'
language: system
files: ^admin/src/.*\.(vue|ts|js)$
pass_filenames: false
# ---------------------------------------------------------------------------
# Security (optional - requires baseline file)
# ---------------------------------------------------------------------------
# - repo: https://github.com/Yelp/detect-secrets
# rev: v1.4.0
# hooks:
# - id: detect-secrets
# args: ['--baseline', '.secrets.baseline']
# exclude: ^(admin/node_modules/|\.env\.docker|package-lock\.json)
# ---------------------------------------------------------------------------
# Docker
# ---------------------------------------------------------------------------
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
args: [--ignore, DL3003, --ignore, DL3008, --ignore, DL3013] # Ignore WORKDIR/cd style + apt-get version pinning
# =============================================================================
# CI Configuration
# =============================================================================
ci:
autofix_prs: true
autoupdate_schedule: monthly
skip:
- eslint # Requires npm
- mypy # Requires additional dependencies