Skip to content

Commit d90af38

Browse files
committed
chore: integrate ruff for linting and update GitHub Actions workflow to format code
1 parent b7615f4 commit d90af38

File tree

14 files changed

+28
-14
lines changed

14 files changed

+28
-14
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ jobs:
5757
python -m pip install --upgrade pip
5858
pip install -e ".[dev]"
5959
60+
- name: Format code with black
61+
run: black src tests examples
62+
6063
- name: Run ruff
6164
run: ruff check src tests examples
6265

6366
- name: Run mypy
6467
run: mypy src/authkit_token
65-
66-
- name: Check formatting with black
67-
run: black --check src tests examples
6868

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://pre-commit.com for more information
2+
# To use: pip install pre-commit, then run: pre-commit install
3+
repos:
4+
- repo: https://github.com/psf/black
5+
rev: 24.3.0
6+
hooks:
7+
- id: black
8+
language_version: python3.9
9+
10+
- repo: https://github.com/astral-sh/ruff-pre-commit
11+
rev: v0.3.0
12+
hooks:
13+
- id: ruff
14+
args: [--fix]
15+
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v4.5.0
18+
hooks:
19+
- id: trailing-whitespace
20+
- id: end-of-file-fixer
21+
- id: check-yaml
22+
- id: check-added-large-files
23+
- id: check-merge-conflict
24+

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ lint:
2424

2525
format:
2626
black src tests examples
27+
ruff check --fix src tests examples
2728

2829
type-check:
2930
mypy src/authkit_token

examples/basic_usage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ def custom_configuration_example() -> None:
5555

5656
print("\n=== Custom Configuration Example ===")
5757
custom_configuration_example()
58-

examples/fastapi_endpoint.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@ async def create_authkit_token(request: TokenRequest):
4747
import uvicorn
4848

4949
uvicorn.run(app, host="0.0.0.0", port=8000)
50-

examples/flask_endpoint.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ def create_authkit_token():
3636

3737
if __name__ == "__main__":
3838
app.run(debug=True, port=5000)
39-

src/authkit_token/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@
3636
"CreateEventLinkPayload",
3737
"IdentityType",
3838
]
39-

src/authkit_token/api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,3 @@ def create_event_link_token_sync(
258258
return cast(AuthkitResponse, error.response.json()) if error.response else None
259259
except Exception:
260260
return None
261-

src/authkit_token/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,3 @@ async def create_async(
138138

139139
result = await create_event_link_token_async(headers, url, payload if payload else None)
140140
return result
141-

src/authkit_token/types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,3 @@ class ClientConfig(TypedDict, total=False):
143143
"""Configuration for AuthKitToken client."""
144144

145145
base_url: Optional[str]
146-

0 commit comments

Comments
 (0)