Skip to content
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

[pre-commit.ci] pre-commit autoupdate #279

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: buildifier
- id: buildifier-lint
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
rev: v1.11.0
hooks:
- id: mypy
additional_dependencies: [types-requests==2.31.0.20240218]
Expand Down
18 changes: 10 additions & 8 deletions py_proto/proto_import.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Any, Iterator, Optional

from py_proto.proto_node import ParsedProtoNode, ProtoNode, ProtoNodeDiff
from py_proto.proto_string_literal import ProtoStringLiteral
Expand Down Expand Up @@ -26,19 +26,21 @@ def __eq__(self, other) -> bool:
and (hasattr(other, "public") and self.public == other.public)
)

def __iter__(self) -> Iterator:
return iter(
{
"path": self.path.serialize(),
"weak": self.weak,
"public": self.public,
}
)

def __str__(self) -> str:
return f"<ProtoImport path={self.path.serialize()} weak={self.weak} public={self.public}>"

def __repr__(self) -> str:
return str(self)

def __dict__(self):
return {
"path": self.path.serialize(),
"weak": self.weak,
"public": self.public,
}

def normalize(self) -> "ProtoImport":
return self

Expand Down
8 changes: 4 additions & 4 deletions py_proto/proto_syntax.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from enum import Enum
from typing import Optional
from typing import Any, Iterator, Optional

from py_proto.proto_node import ParsedProtoNode, ProtoNode, ProtoNodeDiff
from py_proto.proto_string_literal import ProtoStringLiteral
Expand All @@ -23,15 +23,15 @@ def __init__(self, syntax: ProtoStringLiteral, *args, **kwargs):
def __eq__(self, other) -> bool:
return self.syntax == other.syntax

def __iter__(self) -> Iterator:
return iter({"syntax": self.syntax.serialize()})

def __str__(self) -> str:
return f"<ProtoSyntax syntax={self.syntax.serialize()}>"

def __repr__(self) -> str:
return str(self)

def __dict__(self):
return {"syntax": self.syntax.serialize()}

def normalize(self) -> "ProtoSyntax":
return self

Expand Down