-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
109 lines (102 loc) · 2.67 KB
/
.pre-commit-config.yaml
File metadata and controls
109 lines (102 loc) · 2.67 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
103
104
105
106
107
108
109
minimum_pre_commit_version: "3.7.0"
# Global exclude patterns for all hooks
exclude: |
(?x)^(
node_modules/.*|
nina/.*|
\.next/.*|
out/.*|
coverage/.*|
src-tauri/target/.*|
src-tauri/gen/.*|
pnpm-lock\.yaml|
.*\.tsbuildinfo
)$
repos:
# Basic file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-yaml
args: [--unsafe]
- id: check-json
exclude: '^\.vscode/.*\.json$'
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-case-conflict
- id: mixed-line-ending
args: [--fix=lf]
- id: detect-private-key
# Prevent direct commits to main/master (enable in CI or when needed)
# - id: no-commit-to-branch
# args: [--branch, main, --branch, master]
# Prettier formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
additional_dependencies:
- prettier@3.3.3
types_or: [javascript, jsx, ts, tsx, css, scss, json, markdown, yaml]
exclude: |
(?x)^(
pnpm-lock\.yaml|
\.vscode/.*\.json
)$
# ESLint for JS/TS
- repo: local
hooks:
- id: eslint
name: eslint
entry: pnpm exec eslint
args:
- --fix
- --max-warnings=0
- .
language: system
types_or: [javascript, jsx, ts, tsx]
require_serial: true
pass_filenames: false
exclude: |
(?x)^(
node_modules/.*|
nina/.*|
\.next/.*|
out/.*|
coverage/.*
)$
# TypeScript type checking
- id: tsc
name: typescript-check
entry: pnpm exec tsc
args: [--noEmit, --skipLibCheck]
language: system
types: [ts, tsx]
pass_filenames: false
require_serial: true
# Rust formatting (for Tauri)
- id: cargo-fmt
name: cargo-fmt
entry: cargo fmt
args: [--manifest-path, src-tauri/Cargo.toml, --]
language: system
files: ^src-tauri/.*\.rs$
pass_filenames: false
# Rust clippy linting (for Tauri)
- id: cargo-clippy
name: cargo-clippy
entry: cargo clippy
args:
- --manifest-path
- src-tauri/Cargo.toml
- --
- -D
- warnings
language: system
files: ^src-tauri/.*\.rs$
pass_filenames: false
require_serial: true