-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
133 lines (120 loc) · 3.89 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
123
124
125
126
127
128
129
130
131
132
133
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
name: Check YAML formatting
- id: detect-private-key
name: Check for private keys
- id: end-of-file-fixer
files: \.(sql|scss|md|js|ts|tsx|go|yml|yaml)$
name: Add newlines to ends of files
exclude: src/gql/generated/.* # Ignore generated FE files
- repo: https://github.com/detailyang/pre-commit-shell
rev: v1.0.6
hooks:
- id: shell-lint
name: Lint shell files
- repo: https://github.com/trussworks/pre-commit-hooks
rev: v1.1.1
hooks:
- id: mdspell
name: Spellcheck Markdown files
exclude: >
(?x)^(
.github/PULL_REQUEST_TEMPLATE.md|
node_modules/|
vendor
)$
- repo: https://github.com/Bahjat/pre-commit-golang
rev: v1.0.3
hooks:
- id: go-fmt-import
name: Run "goimports" on go files
args: ['-local', 'github.com/cms-enterprise/mint-app']
files: .*\.go$
exclude: >
(?x)^(
.*gen/.*|
.*generated/.*|
.*models_gen.go|
)$
- repo: https://github.com/golangci/golangci-lint
rev: v1.62.2
hooks:
- id: golangci-lint-full
name: Lint go files
- repo: local
hooks:
- id: dockerfilelint
name: Lint Dockerfile
entry: dockerfilelint
language: node
additional_dependencies: [dockerfilelint]
files: Dockerfile.*
- repo: local
hooks:
- id: eslint
name: Run eslint
entry: scripts/pre-commit-eslint
language: script
files: \.(js|jsx|ts|tsx)$
exclude: (\.(d\.ts)$)|(\.storybook)|(serviceWorker\.ts)|(src/gql/generated/.*) # This should match the .eslintrc "ignorePatterns". Change one, change the other!
- repo: local
hooks:
- id: tsc-check
name: Run typescript check
entry: scripts/pre-commit-tsc
language: script
files: \.(js|jsx|ts|tsx)$
pass_filenames: false
- repo: local
hooks:
- id: graphql-schema
name: Lint GraphQL schema
entry: scripts/pre-commit-graphql-schema-lint
language: script
files: "pkg/graph/schema/.*\\.graphql"
pass_filenames: false
- repo: local
hooks:
- id: check-code-generation
name: Run GraphQL code generation
entry: scripts/pre-commit-check-code-generation
language: script
files: "pkg/graph/.*\\.go|pkg/graph/.*\\.graphql|src/gql/operations.*\\.ts"
pass_filenames: false
- repo: https://github.com/awslabs/git-secrets
rev: b9e96b3212fa06aea65964ff0d5cda84ce935f38
hooks:
- id: git-secrets
name: Check for committed secrets
entry: git-secrets --pre_commit_hook
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.2.5
hooks:
- id: sqlfluff-fix
# Exclude SQL files in the migrations folder with version numbers V0 to V180.
# Matches single-digit (e.g., V0), two-digit (e.g., V99), and three-digit (e.g., V180) versions.
exclude: 'migrations/V([0-9]{1,2}|1[0-7][0-9]|180)__'
- id: sqlfluff-lint
# Exclude SQL files in the migrations folder with version numbers V0 to V180.
# Matches single-digit (e.g., V0), two-digit (e.g., V99), and three-digit (e.g., V180) versions.
exclude: 'migrations/V([0-9]{1,2}|1[0-7][0-9]|180)__'
- repo: local
hooks:
- id: remove-postman-ids
name: Remove Postman Collection IDs
language: script
entry: scripts/edit_postman_json.sh
always_run: true
pass_filenames: false
- repo: local
hooks:
- id: run-translation-mappings
name: Run translation/mapping exports
language: script
entry: scripts/translation_mappings.sh
files: "src/i18n/.*|mappings/.*"
pass_filenames: false