-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.pre-commit-config.yaml
122 lines (116 loc) · 3.74 KB
/
.pre-commit-config.yaml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
default_install_hook_types: [pre-commit, pre-push, commit-msg]
fail_fast: true
repos:
- repo: local
hooks:
- id: go-test
name: go-test
language: golang
entry: bash -c 'find . -name go.mod -execdir go test ./... \; | grep -zqv FAIL'
stages: [pre-push]
- id: check-cli-dump-tree-output
name: check "cli dump-tree" output
language: system
entry: bash -c './scripts/gen_expected_cli_dump_tree_output_file.sh'
require_serial: true
stages: [pre-commit]
- id: check-cli-docs-outputs
name: check "cli doc" outputs
language: system
entry: bash -c './scripts/gen_expected_cli_doc_output_file.sh'
require_serial: true
stages: [pre-commit]
- id: apply-oapi-customizations
name: apply-oapi-customizations
language: system
types_or: [yaml]
entry: bash -c './scripts/oapi_apply_customizations.sh'
stages: [pre-commit]
- id: oapi-index-gen
name: oapi-index-gen
language: python
entry: bash -c './scripts/oapi_index_gen.sh'
additional_dependencies: [PyYAML, typing, argparse]
stages: [pre-commit]
- id: check-openapi-links
name: check openapi links
language: system
entry: bash -c './scripts/oapi_check_links.sh'
stages: [pre-commit]
require_serial: true
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
stages: [pre-commit, pre-push]
exclude: >
(?x)(
^mgc/sdk/version.txt|
^script-qa/
^mgc/cli/docs/|
)
- id: end-of-file-fixer
stages: [pre-commit, pre-push]
exclude: >
(?x)(
^mgc/sdk/version.txt|
^script-qa/
^mgc/cli/docs/|
)
- id: check-yaml
stages: [pre-commit, pre-push]
- id: check-added-large-files
exclude: ^script-qa/
stages: [pre-commit, pre-push]
- id: check-shebang-scripts-are-executable
stages: [pre-commit, pre-push]
- id: check-merge-conflict
stages: [pre-commit, pre-push]
- id: mixed-line-ending
stages: [pre-commit, pre-push]
- repo: https://github.com/golangci/golangci-lint
rev: v1.61.0
hooks:
- id: golangci-lint
stages: [pre-commit]
# Need to specify manually due to this issue:
# https://github.com/golangci/golangci-lint/issues/2654
entry: bash -c "go list -f '{{.Dir}}/...' -m | xargs golangci-lint run --fix --new-from-rev HEAD"
- repo: https://github.com/golangci/golangci-lint
rev: v1.61.0
hooks:
- id: golangci-lint
stages: [pre-push]
# Need to specify manually due to this issue:
# https://github.com/golangci/golangci-lint/issues/2654
entry: bash -c "go list -f '{{.Dir}}/...' -m | xargs golangci-lint run --fix"
- repo: https://github.com/TekWizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-mod-tidy
stages: [pre-commit]
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.10.0
hooks:
- id: commitizen
stages: [commit-msg]
- repo: https://github.com/pycqa/flake8
rev: 7.1.0
hooks:
- id: flake8
stages: [pre-commit, pre-push]
additional_dependencies:
- flake8-builtins
- flake8-colors
- flake8-comprehensions
- flake8-deprecated
- flake8-module-name
- flake8-print
- flake8-requirements
- flake8-rst-docstrings
- flake8-tidy-imports
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
stages: [pre-commit, pre-push]