forked from iOfficeAI/AionUi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
88 lines (81 loc) · 2.73 KB
/
.pre-commit-config.yaml
File metadata and controls
88 lines (81 loc) · 2.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
# Pre-commit configuration for AionUi
# Ensures local checks match CI checks (TypeScript, Oxlint, Oxfmt)
#
# Installation:
# pip install pre-commit (or: brew install pre-commit / choco install pre-commit)
# prek install (or: pre-commit install)
#
# Run manually on staged files (same as CI pre-commit):
# prek run
#
# Run on changed files vs main (same as CI PR check):
# prek run --from-ref origin/main --to-ref HEAD
#
# Run on all files:
# prek run --all-files
default_install_hook_types:
- pre-commit
- commit-msg
repos:
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
args: [--unsafe]
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: check-case-conflict
- id: check-added-large-files
args: [--maxkb=1000]
- id: end-of-file-fixer
# Only fix text files, exclude binary files and special OS files
exclude: '^(\.DS_Store|Thumbs\.db|.*\.(png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|otf|pdf|zip|tar|gz|bz2|7z|exe|dll|so|dylib|node|bin))$'
- id: trailing-whitespace
# Auto-fix trailing whitespace in text files
# Excludes binary files (matching end-of-file-fixer pattern)
exclude: '^(\.DS_Store|Thumbs\.db|.*\.(png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|otf|pdf|zip|tar|gz|bz2|7z|exe|dll|so|dylib|node|bin|patch))$'
# TypeScript type checking (full project check required)
- repo: local
hooks:
- id: typecheck
name: TypeScript Check
entry: bunx tsc --noEmit
language: system
files: \.(ts|tsx)$
pass_filenames: false
# Oxlint (replaces ESLint — checks staged files only)
- repo: local
hooks:
- id: oxlint
name: Oxlint
entry: bun run lint
language: system
files: \.(ts|tsx|js|jsx)$
pass_filenames: false
# Oxfmt (replaces Prettier — auto-fixes staged files only)
- repo: local
hooks:
- id: oxfmt
name: Oxfmt
entry: bun run format
language: system
files: \.(ts|tsx|js|jsx|json|css|md|yaml|yml|toml)$
pass_filenames: true
# i18n translation files validation
- repo: local
hooks:
- id: i18n-check
name: i18n Check
entry: node scripts/check-i18n.js
language: system
files: ^src/renderer/services/i18n/locales/
pass_filenames: false
# Commit message format (Conventional Commits)
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [--strict, --force-scope, feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert]