forked from elastic/apm-pipeline-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-hooks.yaml
80 lines (80 loc) · 2.87 KB
/
.pre-commit-hooks.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
- id: check-bash-syntax
name: check-bash-syntax
description: "Check Shell scripts syntax correctness, requires bash"
language: system
entry: bash -n
files: \.sh$
exclude: ^target/
- id: check-abstract-classes-and-trait
name: check-abstract-classes-and-trait
description: "Ensure neither abstract classes nor traits are used"
language: pygrep
entry: "^(abstract|trait) "
files: ^(src|vars)/.*\.groovy$
exclude: ^target/
- id: check-jsonslurper-class
name: check-jsonslurper-class
description: "Ensure JsonSlurperClassic is used instead of non-serializable JsonSlurper"
language: pygrep
entry: JsonSlurper[^C]
files: \.groovy$
exclude: ^target/
- id: check-jenkins-pipelines
name: check-jenkins-pipelines
description: "Check the syntax of the Jenkinsfiles, set JENKINS_URL env variable to use another Jenkins instance."
files: ^(.ci/(.*\.groovy|Jenkinsfile)|Jenkinsfile)$
entry: .ci/scripts/validate.sh
language: script
verbose: true
exclude: ^(target/|.ci/jobsDSL)
- id: check-unicode-non-breaking-spaces
name: check-unicode-non-breaking-spaces
description: "Detect unicode non-breaking space character U+00A0 aka M-BM-"
language: system
entry: perl -ne 'print if $m = /\xc2\xa0/; $t ||= $m; END{{exit $t}}'
exclude: >
(?x)^(
target/.*|.*/?\.*.(gif|jpg|png|jar|war)
)$
- id: remove-unicode-non-breaking-spaces
name: remove-unicode-non-breaking-spaces
description: "Remove unicode non-breaking space character U+00A0 aka M-BM-"
language: system
entry: perl -pi* -e 's/\xc2\xa0/ /g && ($t = 1) && print STDERR $_; END{{exit
$t}}'
exclude: >
(?x)^(
target/.*|.*/?\.*.(gif|jpg|png|jar|war)
)$
- id: check-en-dashes
name: check-en-dashes
description: "Detect the EXTREMELY confusing unicode character U+2013"
language: system
entry: perl -ne 'print if $m = /\xe2\x80\x93/; $t ||= $m; END{{exit $t}}'
exclude: ^target/
- id: remove-en-dashes
name: remove-en-dashes
description: "Remove the EXTREMELY confusing unicode character U+2013"
language: system
entry: perl -pi* -e 's/\xe2\x80\x93/-/g && ($t = 1) && print STDERR $_; END{{exit
$t}}'
exclude: ^target/
- id: check-jjbb
name: check-jjbb
description: "Check JJBB files"
files: ^.ci/jobs
entry: .ci/scripts/validate-jjbb.sh
language: script
verbose: true
- id: check-gherkin-lint
name: check-gherkin-lint
description: "Check Gherkin feature syntax correctness, requires docker."
language: script
entry: .ci/scripts/gherkin-lint.sh
files: \.feature$
- id: check-markdown-lint
name: check-markdown-lint
description: "Check markdown links targeting public URLs are not broken, requires docker."
language: script
entry: .ci/scripts/markdown-lint.sh
files: \.md$