-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
93 lines (87 loc) · 2.15 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
repos:
- repo: local
hooks:
- id: no-dash-e
name: nodashe
description: check no editable modules in requirements
entry: '\-e '
language: pygrep
files: ".*requirements.txt"
types: [file]
- 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: forbid-crlf
- id: forbid-tabs
- 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"
# Syntax error
- "--select=E999"
# Mostly have auto fixes available
- "--select=PIE"
# Autofixable quote rules
- "--select=Q"
# Run the formatter.
- id: ruff-format