-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pre-commit-hooks.yaml
71 lines (60 loc) · 2.36 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
---
- id: CVE-2017-18342 # https://msg.pyyaml.org/load
name: Disallow pyyaml.load
entry: '\b(py)?yaml.load\b'
language: pygrep
files: '\.py$'
- id: remove-unicode-zero-width-space
name: Remove the unicode character U+200B (zero width space)
language: system
entry: perl -pi'' -e 's/\xe2\x80\x8b//g && ($t = 1) && print STDERR $_; END{{exit $t}}'
exclude_types: [binary]
- id: remove-unicode-left-to-right-mark
name: Remove the unicode character U+200E (left-to-right mark)
language: system
entry: perl -pi'' -e 's/\xe2\x80\x8e//g && ($t = 1) && print STDERR $_; END{{exit $t}}'
exclude_types: [binary]
- id: remove-unicode-zero-width-non-breaking-spaces
name: Remove the unicode character U+FEFF (zero width non-breaking space)
language: system
entry: perl -pi'' -e 's/\xef\xbb\xbf//g && ($t = 1) && print STDERR $_; END{{exit $t}}'
exclude_types: [binary]
- id: replace-unicode-non-breaking-spaces
name: Replace the unicode character U+00A0 (non-breaking space) with a normal space
language: system
entry: perl -pi'' -e 's/\xc2\xa0/ /g && ($t = 1) && print STDERR $_; END{{exit $t}}'
exclude_types: [binary]
- id: replace-greek-question-mark
name: Replace the unicode character U+003B (Greek question mark) with a semicolon
language: system
entry: perl -pi'' -e 's/\xcd\xbe/;/g && ($t = 1) && print STDERR $_; END{{exit $t}}'
exclude_types: [binary]
- id: replace-en-dashes
name: Replace the unicode character U+2013 (en dash) with a normal dash
language: system
entry: perl -pi'' -e 's/\xe2\x80\x93/-/g && ($t = 1) && print STDERR $_; END{{exit $t}}'
exclude_types: [binary]
- id: sort-ansible-requirements-yml
name: sort ansible requirements.yml files
entry: scripts/sort-ansible-requirements-yml.py
language: script
files: '(^|\/)requirements\.ya?ml$'
# Deprecated hooks are listed below
- id: remove-unicode-non-breaking-spaces
name: Remove unicode non-breaking space character U+00A0
language: script
always_run: True
pass_filenames: False
entry: "scripts/remove-unicode-non-breaking-spaces.sh"
- id: remove-en-dashes
name: Remove the unicode character U+2013 (en dash)
language: script
always_run: True
pass_filenames: False
entry: "scripts/remove-en-dashes.sh"
- id: sort-gitignore
name: Sort contents of .gitignore
language: script
always_run: True
pass_filenames: False
entry: "scripts/sort-gitignore.sh"