Skip to content

Commit 9dcff1b

Browse files
committed
Add pre-commit
Signed-off-by: Stephen Finucane <stephen@that.guru>
1 parent 64fc770 commit 9dcff1b

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v6.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: mixed-line-ending
8+
args: ['--fix', 'lf']
9+
exclude: '.*\.(svg)$'
10+
- id: fix-byte-order-marker
11+
- id: check-executables-have-shebangs
12+
- id: check-merge-conflict
13+
- id: debug-statements
14+
- id: check-yaml
15+
files: .*\.(yaml|yml)$
16+
exclude: '^zuul.d/.*$'
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: v0.15.4
19+
hooks:
20+
- id: ruff-check
21+
args: ['--fix', '--unsafe-fixes']
22+
- id: ruff-format

scripts/update-rtfd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
from urllib2 import urlopen
44

5+
WEB_HOOK = "http://readthedocs.org/build/588"
56

6-
WEB_HOOK = 'http://readthedocs.org/build/588'
77

8-
9-
if __name__ == '__main__':
10-
urlopen(WEB_HOOK, data=' ')
8+
if __name__ == "__main__":
9+
urlopen(WEB_HOOK, data=" ")

testtools/run.py

100755100644
File mode changed.

tox.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ commands =
1212

1313
[testenv:ruff]
1414
deps =
15-
ruff
15+
pre-commit
1616
commands =
17-
ruff check --fix .
18-
ruff format .
17+
pre-commit run -a
1918

2019
[testenv:mypy]
2120
deps =

0 commit comments

Comments
 (0)