Skip to content

Commit

Permalink
⬆️ auto update by pre-commit hooks (#8)
Browse files Browse the repository at this point in the history
* ⬆️ auto update by pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.0 → v0.3.5](astral-sh/ruff-pre-commit@v0.2.0...v0.3.5)

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Apr 7, 2024
1 parent 0ae95af commit ea2a59b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:
autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks"
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.3.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
7 changes: 2 additions & 5 deletions nonebot/adapters/dodo/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@
from pydantic.generics import GenericModel as GenericModel

@overload
def model_validator(*, mode: Literal["before"]):
...
def model_validator(*, mode: Literal["before"]): ...

@overload
def model_validator(*, mode: Literal["after"]):
...
def model_validator(*, mode: Literal["after"]): ...

def model_validator(*, mode: Literal["before", "after"] = "after"):
return root_validator(pre=mode == "before", allow_reuse=True)

def field_validator(__field, *fields, mode: Literal["before", "after"] = "after"):
return validator(__field, *fields, pre=mode == "before", allow_reuse=True)

6 changes: 3 additions & 3 deletions nonebot/adapters/dodo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,9 @@ class CardButton(BaseModel):
type: Literal["button"] = Field(default="button", init=False)
interact_custom_id: Optional[str] = None
click: ButtonClickAction
color: Literal[
"grey", "red", "orange", "green", "blue", "purple", "default"
] = "default"
color: Literal["grey", "red", "orange", "green", "blue", "purple", "default"] = (
"default"
)
name: str
form: Optional["CallbackForm"] = None

Expand Down
8 changes: 4 additions & 4 deletions nonebot/adapters/dodo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def __set_name__(self, owner: Type[B], name: str) -> None:
self.name = name

@overload
def __get__(self, obj: None, objtype: Type[B]) -> "API[B, P, R]":
...
def __get__(self, obj: None, objtype: Type[B]) -> "API[B, P, R]": ...

@overload
def __get__(self, obj: B, objtype: Optional[Type[B]]) -> Callable[P, Awaitable[R]]:
...
def __get__(
self, obj: B, objtype: Optional[Type[B]]
) -> Callable[P, Awaitable[R]]: ...

def __get__(
self, obj: Optional[B], objtype: Optional[Type[B]] = None
Expand Down

0 comments on commit ea2a59b

Please sign in to comment.