Skip to content

Commit 3ea8ffb

Browse files
committed
style: Format
1 parent 0a3d7d4 commit 3ea8ffb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/griffe_pydantic/_internal/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def on_class_instance(self, *, node: ast.AST | ObjectNode, cls: Class, **kwargs:
4747
return
4848

4949
try:
50-
import pydantic
50+
import pydantic # noqa: PLC0415
5151
except ImportError:
5252
_logger.warning("could not import pydantic - models will not be detected")
5353
return

src/griffe_pydantic/_internal/static.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ def _process_attribute(attr: Attribute, cls: Class, *, processed: set[str]) -> N
114114
attr.labels.discard("class-attribute")
115115
attr.labels.discard("instance-attribute")
116116

117-
attr.value = kwargs.get("default", None)
117+
attr.value = kwargs.get("default")
118118
constraints = {kwarg: value for kwarg, value in kwargs.items() if kwarg not in {"default", "description"}}
119119
attr.extra[common._self_namespace]["constraints"] = constraints
120120

121121
# Populate docstring from the field's `description` argument.
122-
if not attr.docstring and (docstring := kwargs.get("description", None)):
122+
if not attr.docstring and (docstring := kwargs.get("description")):
123123
try:
124124
attr.docstring = Docstring(ast.literal_eval(docstring), parent=attr) # type: ignore[arg-type]
125125
except ValueError:

tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_inventory_matches_api(
165165
# YORE: Bump 2: Remove block.
166166
if item.name.startswith(ignore) or item.name in ignore_paths:
167167
continue
168-
168+
169169
if (
170170
item.domain == "py"
171171
and "(" not in item.name

0 commit comments

Comments
 (0)