Skip to content

Commit 540ebd7

Browse files
authored
Update pre-commit to prek (#41)
* Update pre-commit to prek * Fix ci
1 parent 66a2585 commit 540ebd7

7 files changed

Lines changed: 36 additions & 97 deletions

File tree

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ jobs:
3030
- name: Run lint
3131
run: |
3232
source .venv/bin/activate
33-
chmod 755 pre-commit.sh
34-
./pre-commit.sh
33+
chmod 755 prek.sh
34+
./prek.sh

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ pip install fastapi_oauth20
2929
- 完整的授权流程实现
3030
- 用户信息获取和处理
3131
- 错误处理最佳实践
32+
33+
## Development
34+
35+
```shell
36+
uv sync
37+
uv run prek install
38+
uv run prek run --all-files --show-diff-on-failure
39+
```

pre-commit.sh

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

prek.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
prek run --all-files --verbose --show-diff-on-failure

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dev = [
3939
"ty>=0.0.1a23",
4040
]
4141
lint = [
42-
"pre-commit>=4.3.0",
42+
"prek>=0.3.9",
4343
]
4444
docs = [
4545
"mkdocs-material==9.6.7",

requirements.txt

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,18 @@ certifi==2025.10.5
1313
# via
1414
# httpcore
1515
# httpx
16-
cfgv==3.4.0
17-
# via pre-commit
1816
click==8.2.1
1917
colorama==0.4.6 ; sys_platform == 'win32'
2018
# via
2119
# click
2220
# pytest
2321
coverage==7.11.1
2422
# via pytest-cov
25-
distlib==0.4.0
26-
# via virtualenv
2723
exceptiongroup==1.3.0 ; python_full_version < '3.11'
2824
# via
2925
# anyio
3026
# pytest
3127
fastapi==0.119.0
32-
filelock==3.20.0
33-
# via virtualenv
3428
h11==0.16.0
3529
# via httpcore
3630
httpcore==1.0.9
@@ -39,25 +33,19 @@ httpx==0.28.1
3933
# via
4034
# fastapi-oauth20
4135
# respx
42-
identify==2.6.15
43-
# via pre-commit
4436
idna==3.11
4537
# via
4638
# anyio
4739
# httpx
4840
iniconfig==2.1.0
4941
# via pytest
50-
nodeenv==1.9.1
51-
# via pre-commit
5242
packaging==25.0
5343
# via pytest
54-
platformdirs==4.5.0
55-
# via virtualenv
5644
pluggy==1.6.0
5745
# via
5846
# pytest
5947
# pytest-cov
60-
pre-commit==4.3.0
48+
prek==0.3.9
6149
pydantic==2.12.2
6250
# via fastapi
6351
pydantic-core==2.41.4
@@ -70,8 +58,6 @@ pytest==8.4.2
7058
# pytest-cov
7159
pytest-asyncio==1.2.0
7260
pytest-cov==7.0.0
73-
pyyaml==6.0.3
74-
# via pre-commit
7561
respx==0.22.0
7662
sniffio==1.3.1
7763
# via anyio
@@ -92,8 +78,5 @@ typing-extensions==4.15.0
9278
# pytest-asyncio
9379
# starlette
9480
# typing-inspection
95-
# virtualenv
9681
typing-inspection==0.4.2
9782
# via pydantic
98-
virtualenv==20.35.3
99-
# via pre-commit

uv.lock

Lines changed: 21 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)