Skip to content

Commit 9b77989

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

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
- id: fix-byte-order-marker
10+
- id: check-executables-have-shebangs
11+
- id: check-merge-conflict
12+
- id: debug-statements
13+
- id: check-yaml
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.15.4
16+
hooks:
17+
- id: ruff-check
18+
args: ['--fix', '--unsafe-fixes']
19+
- 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)