Skip to content

Commit

Permalink
🎨Followed mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
carefree0910 committed Jun 18, 2024
1 parent e1cffc6 commit 9944120
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cfdraw/parsers/chakra.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TextAlign(str, Enum):
START = "start"


class IChakra(BaseModel, use_enum_values=True):
class IChakra(BaseModel, use_enum_values=True): # type: ignore
w: Optional[str] = Field(None, description="Width")
h: Optional[str] = Field(None, description="Height")
minW: Optional[str] = Field(None, description="Min Width")
Expand Down
10 changes: 5 additions & 5 deletions cfdraw/parsers/noli.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class Group(BaseModel):
INodeType = Union[SingleNodeType, GroupType]


class INode(BaseModel, use_enum_values=True):
class INode(BaseModel, use_enum_values=True): # type: ignore
type: INodeType
alias: str
bboxFields: Matrix2D
Expand Down Expand Up @@ -166,7 +166,7 @@ def all_single_nodes(self) -> Generator[SingleNode, None, None]:
def _generate(nodes: List[INode]) -> Generator[SingleNode, None, None]:
for node in nodes:
if node.type in SingleNodeType:
yield node
yield node # type: ignore
elif node.type in GroupType:
if node.nodes is None:
raise ValueError(f"`Group` '{node.alias}' has no nodes")
Expand Down Expand Up @@ -202,7 +202,7 @@ def bg_node(self) -> Optional[SingleNode]:

def _parse_single_node(info: Dict[str, Any]) -> SingleNode:
core_info = info["info"]
return SingleNode(type=class_name2type[info["className"]], **core_info)
return SingleNode(type=class_name2type[info["className"]], **core_info) # type: ignore


def _parse_group(info: Dict[str, Any]) -> Group:
Expand All @@ -218,8 +218,8 @@ def _parse_group(info: Dict[str, Any]) -> Group:
def parse_node(info: Dict[str, Any]) -> INode:
class_name = info["className"]
if class_name == "Group":
return _parse_group(info)
return _parse_single_node(info)
return _parse_group(info) # type: ignore
return _parse_single_node(info) # type: ignore


def parse_graph(render_info_list: List[Dict[str, Any]]) -> Graph:
Expand Down
2 changes: 1 addition & 1 deletion cfdraw/schema/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ class ISocketResponse(BaseModel):
elapsedTimes: Optional[ElapsedTimes] = Field(None, description="Elapsed times.")


class ISocketMessage(BaseModel, use_enum_values=True):
class ISocketMessage(BaseModel, use_enum_values=True): # type: ignore
"""This should align with `IPythonSocketMessage` at `src/schema/_python.ts`"""

hash: str = Field(..., description="Hash of the current task")
Expand Down
2 changes: 1 addition & 1 deletion cfdraw/schema/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BoardOptions(BaseModel):
maxScale: float = Field(256, ge=2, le=256, description="max global scale")


class GlobalSettings(BaseModel, use_enum_values=True):
class GlobalSettings(BaseModel, use_enum_values=True): # type: ignore
"""This should align with `IGlobalSettings` locates at `cfdraw/.web/src/stores/_python.ts`"""

defaultLang: Optional[noli.Lang] = Field(None, description="default language")
Expand Down

0 comments on commit 9944120

Please sign in to comment.