Skip to content

Commit b48d8d7

Browse files
committed
Use pre-commit hook instead of using dev dep seperatly
1 parent eb11d75 commit b48d8d7

File tree

5 files changed

+99
-164
lines changed

5 files changed

+99
-164
lines changed

.flake8

Lines changed: 0 additions & 10 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 25.1.0
4+
hooks:
5+
- id: black
6+
args: [--line-length=127]
7+
8+
- repo: https://github.com/pycqa/isort
9+
rev: 6.0.1
10+
hooks:
11+
- id: isort
12+
args: [--profile=black, --line-length=127]
13+
14+
- repo: https://github.com/pycqa/flake8
15+
rev: 7.3.0
16+
hooks:
17+
- id: flake8
18+
args: [--max-line-length=127]
19+
20+
- repo: https://github.com/pre-commit/mirrors-mypy
21+
rev: v1.17.1
22+
hooks:
23+
- id: mypy

Makefile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
.PHONY: dep
22
dep:
33
uv sync --extra dev
4+
uv run pre-commit install
45

56
.PHONY: fmt
67
fmt:
7-
uv run black .
8-
uv run isort .
9-
10-
.PHONY: lint
11-
lint:
12-
uv run mypy .
13-
uv run flake8 .
14-
uv run isort --check --diff .
15-
uv run black --check --diff .
16-
17-
.PHONY: fl
18-
fl: fmt lint
8+
uv run pre-commit run --all-files
199

2010
.PHONY: run
2111
run:
@@ -25,5 +15,5 @@ run:
2515
tests:
2616
uv run python -m pytest tests -rP
2717

28-
.PHONY: flt
29-
flt: fmt lint tests
18+
.PHONY: ft
19+
ft: fmt tests

pyproject.toml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,6 @@ dependencies = []
77

88
[project.optional-dependencies]
99
dev = [
10-
"black",
11-
"click",
12-
"flake8",
13-
"isort",
10+
"pre-commit",
1411
"pytest",
15-
"mypy",
1612
]
17-
18-
[tool.black]
19-
line-length = 127
20-
21-
[tool.isort]
22-
include_trailing_comma = true
23-
line_length = 127
24-
multi_line_output = 3
25-
use_parentheses = true
26-
27-
[tool.mypy]
28-
ignore_missing_imports = true

0 commit comments

Comments
 (0)