style: pre-commit

This commit is contained in:
283375 2023-06-06 20:01:53 +08:00
parent 33287b2e3a
commit 5e13685cf4
4 changed files with 19 additions and 3 deletions

14
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

View File

@ -1,4 +1,4 @@
from dataclasses import dataclass, asdict
from dataclasses import asdict, dataclass
from typing import Optional

View File

@ -1,4 +1,4 @@
from typing import TypeVar, Generic
from typing import Generic, TypeVar
T = TypeVar("T")

View File

@ -1,6 +1,8 @@
from typing import Any, Protocol, ClassVar, Dict
from typing import Any, ClassVar, Dict, Protocol
class TDataclass(Protocol):
__dataclass_fields__: ClassVar[Dict]
def __call__(self, *args: Any, **kwds: Any) -> Any:
...