Skip to content

Commit 5068a10

Browse files
authored
stop ignoring some D linting errors (#105)
1 parent 66d1a6c commit 5068a10

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

pydantic_ai_slim/pydantic_ai/messages.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,16 @@ class ModelTextResponse:
139139

140140
@dataclass
141141
class ArgsJson:
142+
"""Tool arguments as a JSON string."""
143+
142144
args_json: str
143145
"""A JSON string of arguments."""
144146

145147

146148
@dataclass
147149
class ArgsDict:
150+
"""Tool arguments as a Python dictionary."""
151+
148152
args_dict: dict[str, Any]
149153
"""A python dictionary of arguments."""
150154

pydantic_ai_slim/pydantic_ai/models/gemini.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,15 @@ def name(self) -> str:
109109

110110

111111
class AuthProtocol(Protocol):
112+
"""Abstract definition for Gemini authentication."""
113+
112114
async def headers(self) -> dict[str, str]: ...
113115

114116

115117
@dataclass
116118
class ApiKeyAuth:
119+
"""Authentication using an API key for the `X-Goog-Api-Key` header."""
120+
117121
api_key: str
118122

119123
async def headers(self) -> dict[str, str]:

pydantic_ai_slim/pydantic_ai/models/test.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@
3131
)
3232

3333

34-
class UnSetType:
35-
def __repr__(self):
36-
return 'UnSet'
37-
38-
39-
UnSet = UnSetType()
40-
41-
4234
@dataclass
4335
class TestModel(Model):
4436
"""A model specifically for testing purposes.
@@ -186,6 +178,8 @@ def _request(self, messages: list[Message]) -> ModelAnyResponse:
186178

187179
@dataclass
188180
class TestStreamTextResponse(StreamTextResponse):
181+
"""A text response that streams test data."""
182+
189183
_text: str
190184
_cost: Cost
191185
_iter: Iterator[str] = field(init=False)
@@ -217,6 +211,8 @@ def timestamp(self) -> datetime:
217211

218212
@dataclass
219213
class TestStreamStructuredResponse(StreamStructuredResponse):
214+
"""A structured response that streams test data."""
215+
220216
_structured_response: ModelStructuredResponse
221217
_cost: Cost
222218
_iter: Iterator[None] = field(default_factory=lambda: iter([None]))

pydantic_ai_slim/pydantic_ai/models/vertexai.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ async def _async_google_auth() -> tuple[BaseCredentials, str | None]:
182182

183183
@dataclass
184184
class BearerTokenAuth:
185+
"""Authentication using a bearer token generated by google-auth."""
186+
185187
credentials: BaseCredentials | ServiceAccountCredentials
186188
token_created: datetime | None = field(default=None, init=False)
187189

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,11 @@ flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
8888
isort = { combine-as-imports = true, known-first-party = ["pydantic_ai"] }
8989
mccabe = { max-complexity = 15 }
9090
ignore = [
91-
"D101", # ignore missing docstring in public class TODO remove
92-
"D102", # ignore missing docstring in public method TODO remove
93-
"D107", # ignore missing docstring in __init__ methods
9491
"D100", # ignore missing docstring in module
92+
"D102", # ignore missing docstring in public method
9593
"D104", # ignore missing docstring in public package
9694
"D105", # ignore missing docstring in magic methods
95+
"D107", # ignore missing docstring in __init__ methods
9796
]
9897

9998
[tool.ruff.lint.pydocstyle]
@@ -107,7 +106,7 @@ quote-style = "single"
107106
[tool.ruff.lint.per-file-ignores]
108107
"tests/**/*.py" = ["D"]
109108
"docs/**/*.py" = ["D"]
110-
"pydantic_ai_examples/**/*.py" = ["D103"]
109+
"pydantic_ai_examples/**/*.py" = ["D101", "D103"]
111110

112111
[tool.pyright]
113112
typeCheckingMode = "strict"

0 commit comments

Comments
 (0)