Skip to content

Feat/update pre commit #771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 16 additions & 49 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,20 @@
exclude: '^.*\.(md|MD)$'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args:
[
"--profile",
"black",
"--multi-line=3",
"--trailing-comma",
"--force-grid-wrap=0",
"--use-parentheses",
"--line-width=88",
]
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
args: ["--py37-plus", "--keep-runtime-typing"]

- repo: https://github.com/myint/autoflake.git
rev: v2.3.0
hooks:
- id: autoflake
args:
[
"--in-place",
"--remove-all-unused-imports",
"--ignore-init-module-imports",
]

- repo: https://github.com/psf/black
rev: "23.1.0"
hooks:
- id: black

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
args: ["--py37-plus", "--keep-runtime-typing"]

- repo: https://github.com/commitizen-tools/commitizen
rev: v2.20.3
hooks:
- id: commitizen
stages: [commit-msg]
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.20.3
hooks:
- id: commitizen
stages: [commit-msg]
1 change: 1 addition & 0 deletions supabase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"PostgrestAPIError",
"PostgrestAPIResponse",
"StorageException",
"ClientOptions",
"__version__",
]
2 changes: 1 addition & 1 deletion supabase/_async/auth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(
persist_session: bool = True,
storage: AsyncSupportedStorage = AsyncMemoryStorage(),
http_client: Optional[AsyncClient] = None,
flow_type: AuthFlowType = "implicit"
flow_type: AuthFlowType = "implicit",
):
"""Instantiate SupabaseAuthClient instance."""
if headers is None:
Expand Down
2 changes: 1 addition & 1 deletion supabase/_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ async def _get_token_header(self):
try:
session = await self.auth.get_session()
access_token = session.access_token
except Exception as err:
except Exception:
access_token = self.supabase_key

return self._create_auth_header(access_token)
Expand Down
2 changes: 1 addition & 1 deletion supabase/_sync/auth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(
persist_session: bool = True,
storage: SyncSupportedStorage = SyncMemoryStorage(),
http_client: Optional[SyncClient] = None,
flow_type: AuthFlowType = "implicit"
flow_type: AuthFlowType = "implicit",
):
"""Instantiate SupabaseAuthClient instance."""
if headers is None:
Expand Down
2 changes: 1 addition & 1 deletion supabase/_sync/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def _get_token_header(self):
try:
session = self.auth.get_session()
access_token = session.access_token
except Exception as err:
except Exception:
access_token = self.supabase_key

return self._create_auth_header(access_token)
Expand Down
6 changes: 3 additions & 3 deletions supabase/lib/client_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class ClientOptions:
realtime: Optional[Dict[str, Any]] = None
"""Options passed to the realtime-py instance"""

postgrest_client_timeout: Union[
int, float, Timeout
] = DEFAULT_POSTGREST_CLIENT_TIMEOUT
postgrest_client_timeout: Union[int, float, Timeout] = (
DEFAULT_POSTGREST_CLIENT_TIMEOUT
)
"""Timeout passed to the SyncPostgrestClient instance."""

storage_client_timeout: Union[int, float, Timeout] = DEFAULT_STORAGE_CLIENT_TIMEOUT
Expand Down