-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
117 lines (111 loc) · 3.54 KB
/
.pre-commit-config.yaml
File metadata and controls
117 lines (111 loc) · 3.54 KB
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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-json
- id: check-xml
- id: check-xml
types: [file] # without that key check doesn't work
files: \.(project|cproject|mcproject)$
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: pretty-format-json
args:
- --autofix
- --no-ensure-ascii
- --no-sort-keys
- id: check-merge-conflict
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args:
- --config-data
- >
{
extends: default,
rules: {
document-start: {
present: false
},
line-length: {
max: 160
}
}
}
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: insert-license
files: ""
types_or: [c, header]
args:
- --comment-style=//
- id: insert-license
files: \.(asm|s\d?)$
types_or: [text]
args:
- --comment-style=#
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.5
hooks:
- id: clang-format
args:
- --style=google
- repo: local
hooks:
- id: dont-use-uppercase
name: check no uppercase in filenames
entry: <entry command is not used>
language: fail
files: .*[A-ZА-Я]+.*
exclude: ^.*README\.md$|^LICENSE\.txt$|^Pipfile$
- id: ascii-names-check
name: Non-ASCII chars in filenames check
language: python
entry: |
python -c '
import os, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8")
MAX_ASCII = 0x7F
invalid = {}
for fullpath in sys.argv[1:]:
try:
bad_chars = {i: (c, f"0x{ord(c):04X}") for i, c in enumerate(fullpath) if ord(c) > MAX_ASCII}
if bad_chars:
invalid[fullpath] = bad_chars
except Exception as e:
print(f"Warning: {fullpath} - {str(e)}", file=sys.stderr)
if invalid:
print("ERROR: Non-ASCII characters found in paths:", file=sys.stderr)
for path, chars in invalid.items():
char_list = ", ".join(f"{c}({code})" for c, code in chars.values())
print(f" - {path}: {char_list}", file=sys.stderr)
pointer_line = [" "] * len(path)
for pos in chars.keys():
pointer_line[pos] = "^"
print(" " + "".join(pointer_line), file=sys.stderr)
sys.exit(1)
'
- repo: https://github.com/bmorcos/pre-commit-hooks-cpp
rev: 9a5aa38207bf557961110d6a4f7e3a9d352911f9
hooks:
- id: cppcheck
args:
- --inline-suppr
- --language=c
- --force
- repo: https://review.elvees.com/pre-commit-hooks
rev: 29af4c62c1898246963b86fffcddd3e20d42b815
hooks:
- id: check-copyright
- id: check-copyright
types_or: [] # without that key check doesn't work
files: ^.*\.mdb$
- id: check-copyright
types_or: [] # without that key check doesn't work
files: \.(asm|s\d?)$