-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
58 lines (56 loc) · 1.69 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
58 lines (56 loc) · 1.69 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
repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^(smithy-models/|internal/generated/)
- id: end-of-file-fixer
exclude: ^(smithy-models/|internal/generated/)
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-json
- id: check-merge-conflict
- id: check-added-large-files
args: [--maxkb=500]
exclude: ^(smithy-models/|internal/generated/)
# Go
- repo: local
hooks:
- id: go-spdx-header
name: go SPDX header
entry: bash scripts/add-spdx-header.sh
language: system
types: [go]
- id: go-fmt
name: gofmt
entry: gofmt -l -w
language: system
types: [go]
exclude: ^internal/generated/
# CGO_ENABLED=0, matching .goreleaser.yaml and the CI workflows: it is the
# mode releases are built in, and no dependency needs a C toolchain, so a
# contributor without one still gets these hooks.
- id: go-vet
name: go vet
entry: bash -c 'CGO_ENABLED=0 go vet ./...'
language: system
pass_filenames: false
types: [go]
exclude: ^internal/generated/
- id: go-build
name: go build
entry: bash -c 'CGO_ENABLED=0 go build ./...'
language: system
pass_filenames: false
types: [go]
exclude: ^internal/generated/
# Python (ruff - linter & formatter)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.1
hooks:
- id: ruff
args: [--fix]
types_or: [python]
- id: ruff-format
types_or: [python]