-
Notifications
You must be signed in to change notification settings - Fork 7
/
.pre-commit-hooks.yaml
84 lines (83 loc) · 2.8 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
81
82
83
84
- id: american-eg-ie
name: US English requires a comma after "e.g." and "i.e."
description: US English requires a comma after "e.g." and "i.e."
entry: "((e\\.g\\.)|(i\\.e\\.))[^,]"
language: pygrep
types: [file, tex]
minimum_pre_commit_version: "2.8.0"
- id: cleveref-capitalization
name: Ensure the correct usage of \cref
description: Ensure that \Cref at a sentence start is capitalized and nowhere else in the sentence.
entry: |
(?x)
^(
(?# Consume leading whitespace )
\s*
(?# Warn if a lowercase command is used at the beginning of a line, modulo whitespace )
\\(?:cref|crefrange|cpageref|cpagerefrange|namecref|namecrefs)\b
|
(?:
(?# Do not match if the cref is part of a comment )
[^%\s][^%]*
\\(?:Cref|Crefrange|Cpageref|Cpagerefrange|nameCref|nameCrefs)\b
)
).*$
language: pygrep
types: [file, tex]
minimum_pre_commit_version: "2.8.0"
- id: cispa-syssec-forbidden-words
name: Forbidden words for CISPA SysSec
entry: "(?i)blacklist|whitelist"
language: pygrep
types: [file, tex]
minimum_pre_commit_version: "2.8.0"
- id: consistent-spelling
name: Ensure consistency between different spelling variants
description: Ensure that all variants (specified by regex) are written the same way.
entry: consistent_spelling
language: python
types: [file, tex]
minimum_pre_commit_version: "2.8.0"
require_serial: true
language_version: python3
- id: csquotes
name: All quotation marks should use csquotes
description: Ensure the use of LaTeX csquotes and prohibits manual quotation marks.
entry: "``.*''|''.*''"
language: pygrep
types: [file, tex]
minimum_pre_commit_version: "2.8.0"
- id: ensure-labels-for-sections
name: Ensure each section has a matching label
entry: ensure-labels
language: rust
types: [file, tex]
minimum_pre_commit_version: "2.8.0"
- id: no-space-in-cite
name: "Ensure there are no whitespace characters in the \\cite command"
entry: '\\cite\{([^\}]*\s)+[^\}]*\}'
language: pygrep
types: [file, tex]
minimum_pre_commit_version: "2.8.0"
- id: tilde-cite
name: Each \cite needs a ~
description: Line breaks should never occur before the citation, thus they need to be protected with the ~.
entry: "[\\s\\}]\\\\cite\\b"
language: pygrep
types: [file, tex]
minimum_pre_commit_version: "2.8.0"
- id: unique-labels
name: Ensure each label is only defined once.
entry: unique_labels
language: python
types: [file, tex]
minimum_pre_commit_version: "2.8.0"
require_serial: true
language_version: python3
- id: cleveref-instead-of-autoref
name: "Use \\Cref / \\cref instead of \\autoref"
description: "Suggest replacing \\autoref with either \\Cref or \\cref."
entry: "\\\\autoref"
language: pygrep
types: [file, tex]
minimum_pre_commit_version: "2.8.0"