1
1
---
2
2
repos :
3
+ - repo : https://github.com/pre-commit/mirrors-prettier
4
+ rev : " v3.0.0-alpha.6"
5
+ hooks :
6
+ - id : prettier
7
+ name : 💄 Ensuring files are prettier
8
+ types : [yaml, json, markdown]
9
+ - repo : https://github.com/koalaman/shellcheck-precommit
10
+ rev : " v0.9.0"
11
+ hooks :
12
+ - id : shellcheck
13
+ name : ✅ Check Shell files
3
14
- repo : local
4
15
hooks :
5
- - id : black
6
- name : ☕️ Format using black
16
+ - id : ruff
17
+ name : ✅ Format using ruff
18
+ types : [python]
7
19
language : system
20
+ entry : rye run ruff format
21
+ - id : ruff
22
+ name : ✅ Lint using ruff
8
23
types : [python]
9
- entry : poetry run black
10
- require_serial : true
11
- - id : blacken-docs
12
- name : ☕️ Format documentation examples using black
13
24
language : system
14
- files : ' \.(rst|md|markdown|py|tex)$'
15
- entry : poetry run blacken-docs
16
- require_serial : true
25
+ entry : rye run ruff check
26
+ args : [--fix, --exit-non-zero-on-fix]
17
27
- id : check-ast
18
28
name : 🐍 Check Python AST
19
29
language : system
20
30
types : [python]
21
- entry : poetry run check-ast
31
+ entry : rye run check-ast
22
32
- id : check-case-conflict
23
33
name : 🔠 Check for case conflicts
24
34
language : system
25
- entry : poetry run check-case-conflict
35
+ entry : rye run check-case-conflict
26
36
- id : check-docstring-first
27
37
name : ℹ️ Check docstring is first
28
38
language : system
29
39
types : [python]
30
- entry : poetry run check-docstring-first
40
+ entry : rye run check-docstring-first
31
41
- id : check-executables-have-shebangs
32
42
name : 🧐 Check that executables have shebangs
33
43
language : system
34
44
types : [text, executable]
35
- entry : poetry run check-executables-have-shebangs
45
+ entry : rye run check-executables-have-shebangs
36
46
stages : [commit, push, manual]
37
47
- id : check-json
38
48
name : { Check JSON files
39
49
language : system
40
50
types : [json]
41
- entry : poetry run check-json
51
+ entry : rye run check-json
42
52
- id : check-merge-conflict
43
53
name : 💥 Check for merge conflicts
44
54
language : system
45
55
types : [text]
46
- entry : poetry run check-merge-conflict
56
+ entry : rye run check-merge-conflict
47
57
- id : check-symlinks
48
58
name : 🔗 Check for broken symlinks
49
59
language : system
50
60
types : [symlink]
51
- entry : poetry run check-symlinks
61
+ entry : rye run check-symlinks
52
62
- id : check-toml
53
63
name : ✅ Check TOML files
54
64
language : system
55
65
types : [toml]
56
- entry : poetry run check-toml
66
+ entry : rye run check-toml
57
67
- id : check-xml
58
68
name : ✅ Check XML files
59
69
entry : check-xml
@@ -63,96 +73,57 @@ repos:
63
73
name : ✅ Check YAML files
64
74
language : system
65
75
types : [yaml]
66
- entry : poetry run check-yaml
76
+ entry : rye run check-yaml
67
77
- id : codespell
68
78
name : ✅ Check code for common misspellings
69
79
language : system
70
80
types : [text]
71
81
exclude : |
72
82
(?x)^(
73
- poetry.lock|
74
- CHANGELOG.md
83
+ .lock
75
84
)$
76
- entry : poetry run codespell --ignore-words=.codespell
85
+ entry : rye run codespell --ignore-words=.codespell
77
86
- id : debug-statements
78
87
name : 🪵 Debug Statements and imports (Python)
79
88
language : system
80
89
types : [python]
81
- entry : poetry run debug-statement-hook
90
+ entry : rye run debug-statement-hook
82
91
- id : detect-private-key
83
92
name : 🕵️ Detect Private Keys
84
93
language : system
85
94
types : [text]
86
- entry : poetry run detect-private-key
95
+ entry : rye run detect-private-key
87
96
- id : end-of-file-fixer
88
97
name : ⮐ Fix End of Files
89
98
language : system
90
99
types : [text]
91
- entry : poetry run end-of-file-fixer
100
+ entry : rye run end-of-file-fixer
92
101
stages : [commit, push, manual]
93
102
- id : fix-byte-order-marker
94
103
name : 🚏 Fix UTF-8 byte order marker
95
104
language : system
96
105
types : [text]
97
- entry : poetry run fix-byte-order-marker
106
+ entry : rye run fix-byte-order-marker
98
107
- id : mypy
99
108
name : 🆎 Static type checking using mypy
100
109
language : system
101
110
types : [python]
102
- entry : poetry run mypy
111
+ entry : rye run mypy
103
112
require_serial : true
104
- - id : no-commit-to-branch
105
- name : 🛑 Don't commit to main branch
106
- language : system
107
- entry : poetry run no-commit-to-branch
108
- pass_filenames : false
109
- always_run : true
110
- args :
111
- - --branch=main
112
- - id : poetry
113
- name : 📜 Check pyproject with Poetry
114
- language : system
115
- entry : poetry check
116
- pass_filenames : false
117
- always_run : true
118
113
- id : pytest
119
114
name : 🧪 Running tests and test coverage with pytest
120
115
language : system
121
116
types : [python]
122
- entry : poetry run pytest
117
+ entry : rye run pytest
123
118
pass_filenames : false
124
119
- id : trailing-whitespace
125
120
name : ✄ Trim Trailing Whitespace
126
121
language : system
127
122
types : [text]
128
- entry : poetry run trailing-whitespace-fixer
123
+ entry : rye run trailing-whitespace-fixer
129
124
stages : [commit, push, manual]
130
- - id : vulture
131
- name : 🔍 Find unused Python code with Vulture
132
- language : system
133
- types : [python]
134
- entry : poetry run vulture
135
- pass_filenames : false
136
- require_serial : true
137
125
- id : yamllint
138
126
name : 🎗 Check YAML files with yamllint
139
127
language : system
140
128
types : [yaml]
141
- entry : poetry run yamllint
142
- - id : ruff
143
- name : ⚡️ Check with ruff
144
- language : system
145
- entry : poetry run ruff check
146
- types : [python]
147
- args : ["--force-exclude"]
148
- - repo : https://github.com/pre-commit/mirrors-prettier
149
- rev : " v3.0.0-alpha.6"
150
- hooks :
151
- - id : prettier
152
- name : 💄 Ensuring files are prettier
153
- types : [yaml, json, markdown]
154
- - repo : https://github.com/koalaman/shellcheck-precommit
155
- rev : " v0.9.0"
156
- hooks :
157
- - id : shellcheck
158
- name : ✅ Check Shell files
129
+ entry : rye run yamllint
0 commit comments