Skip to content

Commit 31704ac

Browse files
authored
feat: add more workspace linting rules (#1304)
1 parent db13ec4 commit 31704ac

38 files changed

+204
-237
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ help::
3030
@echo " stop-infra -- Stop all infra used by tests."
3131
@echo " NOTE: run this command to ensure all containers are stopped after tests"
3232

33+
mypy: $(call FORALL_PKGS,mypy)
34+
help::
35+
@echo " mypy -- Run mypy on all files"
3336

3437
ruff:
3538
@uv run ruff check --fix

flake.lock

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

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,28 @@ supabase = { workspace = true }
1818

1919
[tool.pytest.ini_options]
2020
asyncio_mode = "auto"
21+
22+
[tool.ruff]
23+
target-version = "py39"
24+
25+
[tool.ruff.lint]
26+
select = [
27+
# pycodestyle
28+
"E",
29+
# Pyflakes
30+
"F",
31+
# pyupgrade
32+
"UP",
33+
# flake8-bugbear
34+
"B",
35+
# flake8-simplify
36+
# "SIM",
37+
# isort
38+
"I",
39+
"ANN2"
40+
]
41+
ignore = ["F403", "E501", "E402", "UP006", "UP035"]
42+
43+
[tool.ruff.lint.pyupgrade]
44+
# Preserve types, even if a file imports `from __future__ import annotations`.
45+
keep-runtime-typing = true

src/auth/pyproject.toml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,6 @@ lints = [
5050
]
5151
dev = [{ include-group = "lints" }, {include-group = "tests" }]
5252

53-
[tool.ruff.lint]
54-
select = [
55-
# pycodestyle
56-
"E",
57-
# Pyflakes
58-
"F",
59-
# pyupgrade
60-
"UP",
61-
# flake8-bugbear
62-
"B",
63-
# flake8-simplify
64-
# "SIM",
65-
# isort
66-
"I",
67-
"ANN2"
68-
]
69-
ignore = ["F403", "E501", "E402", "UP006", "UP035"]
70-
71-
[tool.ruff.lint.pyupgrade]
72-
# Preserve types, even if a file imports `from __future__ import annotations`.
73-
keep-runtime-typing = true
74-
75-
7653
[tool.pytest.ini_options]
7754
asyncio_mode = "auto"
7855

src/auth/tests/_async/clients.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
from faker import Faker
77
from jwt import encode
8-
from typing_extensions import NotRequired, TypedDict
9-
108
from supabase_auth import AsyncGoTrueAdminAPI, AsyncGoTrueClient
119
from supabase_auth.types import User
10+
from typing_extensions import NotRequired, TypedDict
1211

1312

1413
def mock_access_token() -> str:

src/auth/tests/_async/test_gotrue.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import pytest
55
from jwt import encode
6-
76
from supabase_auth.errors import (
87
AuthApiError,
98
AuthInvalidJwtError,
@@ -489,7 +488,6 @@ async def test_sign_in_with_otp() -> None:
489488
from unittest.mock import patch
490489

491490
from httpx import Response
492-
493491
from supabase_auth.types import AuthOtpResponse
494492

495493
# First test for email OTP

src/auth/tests/_async/test_gotrue_admin_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import uuid
22

33
import pytest
4-
54
from supabase_auth.errors import (
65
AuthApiError,
76
AuthError,

src/auth/tests/_sync/clients.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
from faker import Faker
77
from jwt import encode
8-
from typing_extensions import NotRequired, TypedDict
9-
108
from supabase_auth import SyncGoTrueAdminAPI, SyncGoTrueClient
119
from supabase_auth.types import User
10+
from typing_extensions import NotRequired, TypedDict
1211

1312

1413
def mock_access_token() -> str:

src/auth/tests/_sync/test_gotrue.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import pytest
55
from jwt import encode
6-
76
from supabase_auth.errors import (
87
AuthApiError,
98
AuthInvalidJwtError,
@@ -487,7 +486,6 @@ def test_sign_in_with_otp() -> None:
487486
from unittest.mock import patch
488487

489488
from httpx import Response
490-
491489
from supabase_auth.types import AuthOtpResponse
492490

493491
# First test for email OTP

src/auth/tests/_sync/test_gotrue_admin_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import uuid
22

33
import pytest
4-
54
from supabase_auth.errors import (
65
AuthApiError,
76
AuthError,

0 commit comments

Comments
 (0)