-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.pre-commit-config.yaml
135 lines (123 loc) · 3.03 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
127
128
129
130
131
132
133
134
135
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: check-toml
- id: trailing-whitespace
types_or:
- "python"
- "yaml"
- "json"
- "markdown"
- "html"
- "javascript"
- id: check-byte-order-marker
- id: check-json
- id: forbid-new-submodules
- id: check-added-large-files
args: ['--maxkb=2500']
- id: check-merge-conflict
# TODO this seems to be gathering stuff from outside the virtual env.
# - repo: https://github.com/dhatim/python-license-check
# rev: 0.9.2
# hooks:
# - id: liccheck
# language: system
# args: ["--no-deps"]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-crlf
types_or:
- "python"
- "yaml"
- "json"
- "markdown"
- "html"
- id: forbid-tabs
types_or:
- "python"
- "yaml"
- "json"
- "markdown"
- "html"
- repo: https://github.com/sirosen/texthooks
rev: 0.6.6
hooks:
- id: fix-smartquotes
types_or:
- "python"
- "yaml"
- "json"
- "markdown"
- "html"
- "javascript"
- id: fix-ligatures
types_or:
- "python"
- "yaml"
- "json"
- "markdown"
- "html"
- "javascript"
- id: fix-spaces
types_or:
- "python"
- "yaml"
- "json"
- "markdown"
- "html"
- "javascript"
# Set to select only obvious errors
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.5
hooks:
# Run the linter.
- id: ruff
args:
- "--fix"
# Errors
- "--select=PLE"
- "--select=F"
- "--select=E"
# Syntax error
- "--select=E999"
# Mostly have auto fixes available
- "--select=PIE"
- "--select=UP"
- "--select=NPY"
- "--select=E714"
- "--select=E711"
- "--select=E713"
- "--select=FURB"
# Autofixable quote rules
- "--select=Q"
- "--select=E722"
# Fix bad escape sequence
- "--select=W605"
# Import
- "--select=I"
# Bandit
#- "--select=S"
# Allow long lines for legacy code
- "--config"
- "line-length=140"
# Run the formatter.
- id: ruff-format
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: default\.nix|kaithem/src/js/thirdparty/.*
- repo: local
hooks:
- id: do-eslint
name: do-eslint
entry: bash scripts/eslint-hook.sh
language: system
files: \.(js|mjs|vue|css)$
pass_filenames: false
exclude: kaithem/src/js/thirdparty/.*