forked from dotandev/hintents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
67 lines (60 loc) · 2.8 KB
/
.pre-commit-config.yaml
File metadata and controls
67 lines (60 loc) · 2.8 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
# Pre-commit hooks for strict formatting and linting
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files
repos:
# ──────────────────────────────────────────────
# Go formatting: gofmt + goimports (auto-fix)
# ──────────────────────────────────────────────
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
name: gofmt (auto-format)
description: Runs gofmt and auto-formats Go files
- id: go-imports
name: goimports (auto-format)
description: Runs goimports to fix imports and formatting in Go files
# ──────────────────────────────────────────────
# Go linting: golangci-lint (strict)
# ──────────────────────────────────────────────
- repo: https://github.com/golangci/golangci-lint
rev: v1.61.0
hooks:
- id: golangci-lint
name: golangci-lint (strict)
args:
- --config=.golangci.yml
- --max-issues-per-linter=0
- --max-same-issues=0
# ──────────────────────────────────────────────
# Local hooks: go vet, cargo fmt, cargo clippy
# ──────────────────────────────────────────────
- repo: local
hooks:
- id: go-vet
name: go vet
entry: go vet ./...
language: system
pass_filenames: false
files: \.go$
- id: cargo-fmt
name: cargo fmt (auto-format)
entry: bash -c 'cd simulator && cargo fmt'
language: system
pass_filenames: false
files: \.rs$
description: Runs cargo fmt to auto-format all Rust files in simulator/
- id: cargo-fmt-check
name: cargo fmt --check (verify)
entry: bash -c 'cd simulator && cargo fmt --check'
language: system
pass_filenames: false
files: \.rs$
stages: [pre-push]
description: Verifies Rust formatting on push (strict gate)
- id: cargo-clippy
name: cargo clippy (strict)
entry: bash -c 'cd simulator && cargo clippy --all-targets --all-features -- -D warnings -D clippy::all -D unused-variables -D unused-imports -D unused-mut -D dead-code -D unused-assignments -W clippy::pedantic -W clippy::nursery'
language: system
pass_filenames: false
files: \.rs$