python-checks 0.7.0__tar.gz → 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_checks-0.7.0 → python_checks-0.9.0}/PKG-INFO +1 -1
- {python_checks-0.7.0 → python_checks-0.9.0}/pyproject.toml +1 -1
- {python_checks-0.7.0 → python_checks-0.9.0}/pyproject.toml.orig +1 -1
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/api/_edge_declarations.py +58 -12
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_model_columns.py +40 -2
- {python_checks-0.7.0 → python_checks-0.9.0}/LICENSE +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/README.md +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/_kind.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/_layout.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/_location.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/_names.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/api/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/api/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/calls/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/calls/_confined_functions.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/calls/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_bound_checks.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_confined_calls.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_model_boundary.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_raw_sql.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_schema_drift.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_statement_keys.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/effects/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/effects/_determinism.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/effects/_log_events.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/effects/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/errors/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/errors/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/errors/_refusals.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/hygiene/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/hygiene/_dependency_bounds.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/hygiene/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/imports/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/imports/_confined.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/imports/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/imports/_sealed.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/imports/_statements.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/_class_modules.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/_class_placement.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/_operation_shape.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/_required_class.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_function_length.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_functions.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_keyword_only.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_module_length.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_nesting.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_signature_layout.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/_annotation_shapes.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/_config_fields.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/_confined_types.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/_constant_annotations.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/_frozen_dataclasses.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/_marker.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/_app.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/_protocols.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/commands/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/commands/_doctor.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/commands/_explain.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/commands/_list.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/commands/_mutation.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/commands/_run.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/commands/_summary.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/cli/commands/_sync.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/config/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/config/_base.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/config/_config.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/config/_constants.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/config/_errors.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/config/_loader.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/config/_toml.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/contracts/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/contracts/_constants.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/contracts/_layout.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/contracts/_render.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/contracts/_settings.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_constants.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_discovery.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_edit.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_errors.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_fixer.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_format.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_markers.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_paths.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_protocols.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_registry.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_report.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_runner.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_settings.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_source.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/core/_violation.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/environment/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/environment/_constants.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/environment/_render.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/environment/_settings.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/mutation/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/mutation/_baseline.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/mutation/_constants.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/mutation/_errors.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/mutation/_gate.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/mutation/_mutmut.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/mutation/_process.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/mutation/_scope.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/mutation/_settings.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/py.typed +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/sync/__init__.py +0 -0
- {python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/sync/_sync.py +0 -0
|
@@ -47,14 +47,14 @@ class Shape:
|
|
|
47
47
|
# spelling.
|
|
48
48
|
methods: tuple[str, ...]
|
|
49
49
|
|
|
50
|
-
#
|
|
51
|
-
# `post`, `delete`, the same names an HTTP client goes by, and a
|
|
52
|
-
# reading every `.post(...)` would find a route in the first adapter
|
|
53
|
-
# talks to a neighbouring service. A subscription cannot be mistaken
|
|
54
|
-
# anything like that,
|
|
55
|
-
#
|
|
56
|
-
# its client is taken before the start.
|
|
57
|
-
|
|
50
|
+
# Recognised only as a decorator. For a route this is a must: its `methods`
|
|
51
|
+
# are `get`, `post`, `delete`, the same names an HTTP client goes by, and a
|
|
52
|
+
# rule reading every `.post(...)` would find a route in the first adapter
|
|
53
|
+
# that talks to a neighbouring service. A subscription cannot be mistaken
|
|
54
|
+
# for anything like that, so `False` takes it in both forms: as a decorator,
|
|
55
|
+
# `@router.subscriber(...)`, and as a call kept in a variable and applied to
|
|
56
|
+
# the handler separately, because its client is taken before the start.
|
|
57
|
+
decorator_only: bool
|
|
58
58
|
|
|
59
59
|
# The word a message uses for the first argument.
|
|
60
60
|
subject: str
|
|
@@ -73,7 +73,7 @@ class Shape:
|
|
|
73
73
|
KNOWN: Final[dict[str, Shape]] = {
|
|
74
74
|
Framework.FASTAPI: Shape(
|
|
75
75
|
methods=("get", "post", "put", "patch", "delete", "head", "options", "trace"),
|
|
76
|
-
|
|
76
|
+
decorator_only=True,
|
|
77
77
|
subject="path",
|
|
78
78
|
named="path",
|
|
79
79
|
body="response_model",
|
|
@@ -86,7 +86,7 @@ KNOWN: Final[dict[str, Shape]] = {
|
|
|
86
86
|
),
|
|
87
87
|
Framework.FASTSTREAM: Shape(
|
|
88
88
|
methods=("subscriber",),
|
|
89
|
-
|
|
89
|
+
decorator_only=False,
|
|
90
90
|
subject="topic",
|
|
91
91
|
named=None,
|
|
92
92
|
),
|
|
@@ -167,6 +167,13 @@ class EdgeDeclarations:
|
|
|
167
167
|
An entrance taken out of the schema (`include_in_schema=False`) the rule
|
|
168
168
|
leaves alone: the schema is what it protects, and such a route is not in it.
|
|
169
169
|
|
|
170
|
+
A keyword decided once for a whole router or broker counts for every
|
|
171
|
+
entrance on it: `router = KafkaRouter(parser=...)` declares the parser of
|
|
172
|
+
each `router.subscriber(...)`. Only when the object is built in the same
|
|
173
|
+
module, by a call the file shows; built elsewhere, it has nothing to read,
|
|
174
|
+
and the entrance answers for itself. A name assigned twice counts only
|
|
175
|
+
what both constructors passed.
|
|
176
|
+
|
|
170
177
|
Settings: one block per framework, with `required` in it.
|
|
171
178
|
"""
|
|
172
179
|
|
|
@@ -188,6 +195,7 @@ class EdgeDeclarations:
|
|
|
188
195
|
code=CODE,
|
|
189
196
|
).frameworks
|
|
190
197
|
decorators = cls._decorators(tree=file.tree)
|
|
198
|
+
built = cls._built(tree=file.tree)
|
|
191
199
|
for node in ast.walk(file.tree):
|
|
192
200
|
if not isinstance(node, ast.Call):
|
|
193
201
|
continue
|
|
@@ -198,13 +206,17 @@ class EdgeDeclarations:
|
|
|
198
206
|
if found is None:
|
|
199
207
|
continue
|
|
200
208
|
shape, edge = found
|
|
201
|
-
if shape.
|
|
209
|
+
if shape.decorator_only and node not in decorators:
|
|
202
210
|
continue
|
|
203
211
|
yield from cls._judged(
|
|
204
212
|
call=node,
|
|
205
213
|
file=file,
|
|
206
214
|
shape=shape,
|
|
207
215
|
edge=edge,
|
|
216
|
+
inherited=cls._inherited(
|
|
217
|
+
call=node,
|
|
218
|
+
built=built,
|
|
219
|
+
),
|
|
208
220
|
)
|
|
209
221
|
|
|
210
222
|
@staticmethod
|
|
@@ -218,6 +230,39 @@ class EdgeDeclarations:
|
|
|
218
230
|
if isinstance(decorator, ast.Call)
|
|
219
231
|
}
|
|
220
232
|
|
|
233
|
+
@staticmethod
|
|
234
|
+
def _built(*, tree: ast.Module) -> dict[str, frozenset[str]]:
|
|
235
|
+
"""The keywords each name was built with in this module: `router = KafkaRouter(...)`.
|
|
236
|
+
|
|
237
|
+
A name assigned more than once keeps only what every constructor
|
|
238
|
+
passed: which of them the entrance hangs on, the file does not say.
|
|
239
|
+
"""
|
|
240
|
+
found: dict[str, frozenset[str]] = {}
|
|
241
|
+
for node in ast.walk(tree):
|
|
242
|
+
match node:
|
|
243
|
+
case (
|
|
244
|
+
ast.Assign(targets=[ast.Name(id=name)], value=ast.Call() as call)
|
|
245
|
+
| ast.AnnAssign(target=ast.Name(id=name), value=ast.Call() as call)
|
|
246
|
+
):
|
|
247
|
+
passed = frozenset(keyword.arg for keyword in call.keywords if keyword.arg)
|
|
248
|
+
found[name] = found[name] & passed if name in found else passed
|
|
249
|
+
case _:
|
|
250
|
+
continue
|
|
251
|
+
return found
|
|
252
|
+
|
|
253
|
+
@staticmethod
|
|
254
|
+
def _inherited(
|
|
255
|
+
*,
|
|
256
|
+
call: ast.Call,
|
|
257
|
+
built: dict[str, frozenset[str]],
|
|
258
|
+
) -> frozenset[str]:
|
|
259
|
+
"""What the router or broker the entrance hangs on already declared."""
|
|
260
|
+
match call.func:
|
|
261
|
+
case ast.Attribute(value=ast.Name(id=name)):
|
|
262
|
+
return built.get(name, frozenset())
|
|
263
|
+
case _:
|
|
264
|
+
return frozenset()
|
|
265
|
+
|
|
221
266
|
@staticmethod
|
|
222
267
|
def _matched(
|
|
223
268
|
*,
|
|
@@ -241,6 +286,7 @@ class EdgeDeclarations:
|
|
|
241
286
|
file: ParsedFile,
|
|
242
287
|
shape: Shape,
|
|
243
288
|
edge: Edge,
|
|
289
|
+
inherited: frozenset[str],
|
|
244
290
|
) -> Iterator[Violation]:
|
|
245
291
|
if cls._unpublished(
|
|
246
292
|
call=call,
|
|
@@ -251,7 +297,7 @@ class EdgeDeclarations:
|
|
|
251
297
|
call=call,
|
|
252
298
|
shape=shape,
|
|
253
299
|
)
|
|
254
|
-
declared = {keyword.arg for keyword in call.keywords}
|
|
300
|
+
declared = {keyword.arg for keyword in call.keywords} | inherited
|
|
255
301
|
yield from cls._first(
|
|
256
302
|
call=call,
|
|
257
303
|
file=file,
|
|
@@ -21,6 +21,8 @@ CODE: Final = "model-columns"
|
|
|
21
21
|
MAPPED: Final = "Mapped"
|
|
22
22
|
AWARE: Final = "timezone"
|
|
23
23
|
NULLABLE: Final = "nullable"
|
|
24
|
+
RELATIONSHIP: Final = "relationship"
|
|
25
|
+
LAZY: Final = "lazy"
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
class ModelColumnsSettings(ZonedSettings):
|
|
@@ -31,12 +33,13 @@ class ModelColumnsSettings(ZonedSettings):
|
|
|
31
33
|
skip: tuple[str, ...] = ()
|
|
32
34
|
aware: tuple[str, ...] = ()
|
|
33
35
|
nullable: bool = True
|
|
36
|
+
lazy: tuple[str, ...] = ()
|
|
34
37
|
|
|
35
38
|
|
|
36
39
|
class ModelColumns:
|
|
37
40
|
"""Fails if a column is built out of the wrong material.
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
Six rules on one table of settings.
|
|
40
43
|
|
|
41
44
|
`instead` is the material that has no place in a column, and what to write
|
|
42
45
|
instead. A bare `Enum` is a native Postgres type: every new member needs an
|
|
@@ -66,8 +69,15 @@ class ModelColumns:
|
|
|
66
69
|
diverge, and then the annotation lies: pyright reasons by it, the database
|
|
67
70
|
holds the keyword, and one of the two is wrong on every row.
|
|
68
71
|
|
|
72
|
+
`lazy` lists the loaders a `relationship()` may name. Under asyncio an
|
|
73
|
+
implicit load cannot run: touching an unloaded relationship raises
|
|
74
|
+
`MissingGreenlet` far from the query, and where it happens to work it is
|
|
75
|
+
one query per row. `lazy="raise"` makes the query say what it loads, with
|
|
76
|
+
`selectinload` or `joinedload`. A value the file does not show is reported
|
|
77
|
+
too: a loader nobody can read is not one anybody chose.
|
|
78
|
+
|
|
69
79
|
Settings: `zones`, `factories`, `instead`, `wrappers`, `defaults`, `skip`,
|
|
70
|
-
`aware`, `nullable`.
|
|
80
|
+
`aware`, `nullable`, `lazy`.
|
|
71
81
|
"""
|
|
72
82
|
|
|
73
83
|
code: ClassVar[str] = CODE
|
|
@@ -134,6 +144,12 @@ class ModelColumns:
|
|
|
134
144
|
f"{written} without timezone=True stores a naive timestamp; say timezone=True"
|
|
135
145
|
),
|
|
136
146
|
)
|
|
147
|
+
if written == RELATIONSHIP and limits.lazy:
|
|
148
|
+
yield from cls._loaded(
|
|
149
|
+
file=file,
|
|
150
|
+
node=node,
|
|
151
|
+
allowed=limits.lazy,
|
|
152
|
+
)
|
|
137
153
|
if written not in limits.factories:
|
|
138
154
|
return
|
|
139
155
|
for keyword in node.keywords:
|
|
@@ -147,6 +163,28 @@ class ModelColumns:
|
|
|
147
163
|
),
|
|
148
164
|
)
|
|
149
165
|
|
|
166
|
+
@classmethod
|
|
167
|
+
def _loaded(
|
|
168
|
+
cls,
|
|
169
|
+
*,
|
|
170
|
+
file: ParsedFile,
|
|
171
|
+
node: ast.Call,
|
|
172
|
+
allowed: tuple[str, ...],
|
|
173
|
+
) -> Iterator[Violation]:
|
|
174
|
+
"""A relationship that loads behind the query's back."""
|
|
175
|
+
written = next((keyword.value for keyword in node.keywords if keyword.arg == LAZY), None)
|
|
176
|
+
if isinstance(written, ast.Constant) and written.value in allowed:
|
|
177
|
+
return
|
|
178
|
+
said = "without lazy=" if written is None else f"with lazy={ast.unparse(written)}"
|
|
179
|
+
yield cls._says(
|
|
180
|
+
file=file,
|
|
181
|
+
node=node,
|
|
182
|
+
message=(
|
|
183
|
+
f"relationship() {said} loads without the query saying so; "
|
|
184
|
+
f"say lazy={allowed[0]!r} and load it at the query"
|
|
185
|
+
),
|
|
186
|
+
)
|
|
187
|
+
|
|
150
188
|
@classmethod
|
|
151
189
|
def _annotation(
|
|
152
190
|
cls,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/calls/_confined_functions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_confined_calls.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_model_boundary.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/database/_statement_keys.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/hygiene/_dependency_bounds.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/_class_modules.py
RENAMED
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/_class_placement.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/_operation_shape.py
RENAMED
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/placement/_required_class.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_function_length.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_keyword_only.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_module_length.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/signatures/_signature_layout.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/_annotation_shapes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/_constant_annotations.py
RENAMED
|
File without changes
|
{python_checks-0.7.0 → python_checks-0.9.0}/src/py_checks/checks/types/_frozen_dataclasses.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|