generated from NHSDigital/api-management-service-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.pre-commit-config.yaml
126 lines (112 loc) · 3.78 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
repos:
- repo: /~https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
name: Check for merge conflict strings
- id: end-of-file-fixer
name: Fix missing newline at the end of files
- id: check-shebang-scripts-are-executable
name: Check shell scripts are executable
types: [bash, shell]
- id: check-yaml
name: Check pipelines configuration
files: ^(azure|packages\/tool\/azure)
- repo: local
hooks:
- id: lint-models
name: Lint models
entry: npm
args: ["run", "--prefix=packages/models", "lint"]
language: system
files: ^packages\/models
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-coordinator
name: Lint coordinator
entry: npm
args: ["run", "--prefix=packages/coordinator", "lint"]
language: system
files: ^packages\/coordinator
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-epsat-client
name: Lint EPSAT client
entry: npm
args: ["run", "--prefix=packages/tool/site/client", "lint"]
language: system
files: ^packages\/tool\/site\/client
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: lint-epsat-server
name: Lint EPSAT server
entry: npm
args: ["run", "--prefix=packages/tool/site/server", "lint"]
language: system
files: ^packages\/tool\/site\/server
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: oas-build-checks
name: Build OAS
entry: make
args: ["build-specification"]
language: system
files: ^(examples|packages\/specification)
types_or: [json, yaml]
- id: lint-bdd-tests
name: Lint bdd tests
entry: npm
args: ["run", "--prefix=packages/bdd-tests", "lint"]
language: system
files: ^packages\/bdd-tests
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false
- id: build-coordinator
name: Build coordinator
entry: make
args: ["build-coordinator"]
language: system
files: ^packages\/(models|coordinator)
types_or: [ts, tsx, javascript, jsx, json]
- id: build-proxies
name: Build Apigee proxies configuration
entry: make
args: ["build-proxies"]
language: system
files: ^proxies\/(live|sandbox)
types_or: [xml]
- id: check-language-version
name: check language versions are consistent
entry: ./scripts/check_language_versions.sh
language: system
files: |
(?x)^(
.tool-versions|
packages/coordinator/Dockerfile|
azure/azure-build-pipeline.yml|
azure/azure-release-template.yml|
packages/tool/site/Dockerfile|
packages/tool/azure/azure-build-pipeline.yml|
packages/tool/azure/azure-release-template.yml|
.devcontainer/Dockerfile
)$
- id: lint-githubactions
name: Lint github actions
entry: make
args: ["lint-githubactions"]
language: system
files: ^.github
types_or: [yaml]
pass_filenames: false
- repo: local
hooks:
- id: git-secrets
name: Git Secrets
description: git-secrets scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories.
entry: bash
args:
- -c
- 'docker run -v "$LOCAL_WORKSPACE_FOLDER:/src" git-secrets --pre_commit_hook'
language: system
fail_fast: true
default_stages: [commit]