-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
92 lines (84 loc) · 3.23 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
92 lines (84 loc) · 3.23 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
repos:
# Basic file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: trailing-whitespace
exclude: \.lock\.yml$
- id: end-of-file-fixer
exclude: '(\.lock\.yml$|\.svg$)'
- id: check-yaml
args: ["--allow-multiple-documents"]
exclude: ^charts/.*/templates/.*\.yaml$
- id: check-json
- id: check-merge-conflict
- id: check-added-large-files
args: ["--maxkb=600"]
- id: check-docstring-first
- id: debug-statements
# Python code formatting
- repo: https://github.com/psf/black
rev: 87928e6d6761a4a6d22250e1fee5601b3998086e # frozen: 26.5.1
hooks:
- id: black
language_version: python3
# Import sorting
- repo: https://github.com/pycqa/isort
rev: a333737ed43df02b18e6c95477ea1b285b3de15a # frozen: 8.0.1
hooks:
- id: isort
args: ["--profile", "black"]
# Linting
- repo: https://github.com/pycqa/flake8
rev: c48217e1fc006c2dddd14df54e83b67da15de5cd # frozen: 7.3.0
hooks:
- id: flake8
args: ["--max-line-length=88", "--extend-ignore=E203,W503"]
# Typo checking
- repo: https://github.com/crate-ci/typos
rev: 37bb98842b0d8c4ffebdb75301a13db0267cef89 # frozen: v1.47.2
hooks:
- id: typos
# Go linting. Managed by pre-commit in an isolated, version-pinned
# environment, so it does not require a specific golangci-lint on the
# contributor's global PATH. Runs on push, not every commit, because
# linting the whole module is slow.
- repo: https://github.com/golangci/golangci-lint
rev: c0d3ddc9cf3faa61a4e378e879ece580256d76e5 # frozen: v2.12.2
hooks:
- id: golangci-lint-full
stages: [pre-push]
# Go mod tidy and codegen verification. These use the system Go toolchain
# (whatever `go` is on PATH); go.mod's `go` directive is the minimum
# language version, not the toolchain to use. We have not observed the
# generated code differ across current Go toolchains, so these hooks are
# not pinned to a specific one.
- repo: local
hooks:
- id: go-mod-tidy
name: go mod tidy
entry: bash -c 'go mod tidy && git diff --exit-code go.mod go.sum'
language: system
pass_filenames: false
files: '(^go\.mod$|^go\.sum$|\.go$)'
- id: verify-idl-consumption
name: verify IDL consumption
entry: hack/verify-idl-consumption.sh
language: system
pass_filenames: false
# The script deletes and regenerates files and requires a clean
# tree; run on demand / from CI, never on every commit.
stages: [manual]
files: '(^api/|^config/crd/|^Makefile$)'
# Design rule DR-10: GitHub Actions references (see DESIGN_RULES.md). Offline
# here (pin format + tag-comment presence); CI additionally verifies each tag
# resolves to its SHA.
- repo: local
hooks:
- id: check-action-refs
name: Check GitHub Actions references (DR-10)
entry: hack/check-action-refs.py
language: system
# Run when a workflow changes or when the checker itself changes.
files: ^(\.github/workflows/|hack/check-action-refs\.py$)
pass_filenames: false