@neralabs/rerail-pack-python 0.1.2 → 0.1.4

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.
Files changed (144) hide show
  1. package/README.md +707 -3
  2. package/licenses/bandit/UPSTREAM.md +10 -0
  3. package/licenses/ruff/UPSTREAM.md +56 -0
  4. package/pack.json +7 -20
  5. package/package.json +1 -1
  6. package/rules/bandit-b101-assert-used.json +2 -2
  7. package/rules/bandit-b102-exec-used.json +2 -2
  8. package/rules/bandit-b110-try-except-pass.json +1 -1
  9. package/rules/bandit-b112-try-except-continue.json +1 -1
  10. package/rules/bandit-b113-request-without-timeout.json +2 -2
  11. package/rules/bandit-b301-pickle.json +2 -2
  12. package/rules/bandit-b302-marshal.json +2 -2
  13. package/rules/bandit-b303-md5.json +1 -1
  14. package/rules/bandit-b305-cipher-modes.json +2 -2
  15. package/rules/bandit-b306-mktemp-q.json +2 -2
  16. package/rules/bandit-b307-eval.json +1 -1
  17. package/rules/bandit-b308-mark-safe.json +2 -2
  18. package/rules/bandit-b310-urllib-urlopen.json +1 -1
  19. package/rules/bandit-b311-random.json +1 -1
  20. package/rules/bandit-b312-telnetlib.json +1 -1
  21. package/rules/bandit-b313-xml-bad-celementtree.json +1 -1
  22. package/rules/bandit-b314-xml-bad-elementtree.json +1 -1
  23. package/rules/bandit-b315-xml-bad-expatreader.json +1 -1
  24. package/rules/bandit-b316-xml-bad-expatbuilder.json +1 -1
  25. package/rules/bandit-b317-xml-bad-sax.json +1 -1
  26. package/rules/bandit-b318-xml-bad-minidom.json +1 -1
  27. package/rules/bandit-b319-xml-bad-pulldom.json +1 -1
  28. package/rules/bandit-b321-ftplib.json +2 -2
  29. package/rules/bandit-b323-unverified-context.json +2 -2
  30. package/rules/bandit-b401-import-telnetlib.json +2 -2
  31. package/rules/bandit-b402-import-ftplib.json +2 -2
  32. package/rules/bandit-b405-import-xml-etree.json +1 -1
  33. package/rules/bandit-b407-import-xml-expat.json +1 -1
  34. package/rules/bandit-b408-import-xml-minidom.json +1 -1
  35. package/rules/bandit-b409-import-xml-pulldom.json +1 -1
  36. package/rules/bandit-b411-import-xmlrpclib.json +1 -1
  37. package/rules/bandit-b413-import-pycrypto.json +1 -1
  38. package/rules/bandit-b415-import-pyghmi.json +2 -2
  39. package/rules/bandit-b502-ssl-with-bad-version.json +2 -2
  40. package/rules/bandit-b505-weak-cryptographic-key.json +2 -2
  41. package/rules/bandit-b507-ssh-no-host-key-verification.json +2 -2
  42. package/rules/bandit-b606-start-process-with-no-shell.json +2 -2
  43. package/rules/bandit-b615-huggingface-unsafe-download.json +2 -2
  44. package/rules/ruff-async100-cancel-scope-no-checkpoint.json +2 -2
  45. package/rules/ruff-async105-trio-sync-call.json +1 -1
  46. package/rules/ruff-async115-async-zero-sleep.json +1 -1
  47. package/rules/ruff-async116-long-sleep-not-forever.json +1 -1
  48. package/rules/ruff-async210-blocking-http-call-in-async-function.json +2 -2
  49. package/rules/ruff-async221-run-process-in-async-function.json +1 -1
  50. package/rules/ruff-async222-wait-for-process-in-async-function.json +2 -2
  51. package/rules/ruff-async230-blocking-open-call-in-async-function.json +2 -2
  52. package/rules/ruff-async250-blocking-input-in-async-function.json +2 -2
  53. package/rules/ruff-async251-blocking-sleep-in-async-function.json +1 -1
  54. package/rules/ruff-b002-unary-prefix-increment-decrement.json +3 -3
  55. package/rules/ruff-b003-assignment-to-os-environ.json +2 -2
  56. package/rules/ruff-b004-unreliable-callable-check.json +1 -1
  57. package/rules/ruff-b005-strip-with-multi-characters.json +2 -2
  58. package/rules/ruff-b007-unused-loop-control-variable.json +1 -1
  59. package/rules/ruff-b009-get-attr-with-constant.json +1 -1
  60. package/rules/ruff-b010-set-attr-with-constant.json +2 -2
  61. package/rules/ruff-b011-assert-false.json +1 -1
  62. package/rules/ruff-b013-redundant-tuple-in-exception-handler.json +1 -1
  63. package/rules/ruff-b014-duplicate-handler-exception.json +1 -1
  64. package/rules/ruff-b016-raise-literal.json +1 -1
  65. package/rules/ruff-b020-loop-variable-overrides-iterator.json +1 -1
  66. package/rules/ruff-b021-f-string-docstring.json +1 -1
  67. package/rules/ruff-b022-useless-contextlib-suppress.json +1 -1
  68. package/rules/ruff-b023-function-uses-loop-variable.json +2 -2
  69. package/rules/ruff-b025-duplicate-try-block-exception.json +1 -1
  70. package/rules/ruff-b026-star-arg-unpacking-after-keyword-arg.json +1 -1
  71. package/rules/ruff-b028-no-explicit-stacklevel.json +2 -2
  72. package/rules/ruff-b029-except-with-empty-tuple.json +1 -1
  73. package/rules/ruff-b030-except-with-non-exception-classes.json +406 -0
  74. package/rules/ruff-b032-unintentional-type-annotation.json +1 -1
  75. package/rules/ruff-b033-duplicate-value.json +1 -1
  76. package/rules/ruff-b034-re-sub-positional-args.json +1 -1
  77. package/rules/ruff-b039-mutable-contextvar-default.json +2 -2
  78. package/rules/ruff-b904-raise-without-from-inside-except.json +2 -2
  79. package/rules/ruff-b905-zip-without-explicit-strict.json +1 -1
  80. package/rules/ruff-e711-none-comparison.json +1 -1
  81. package/rules/ruff-e721-type-comparison.json +1 -1
  82. package/rules/ruff-e722-bare-except.json +2 -2
  83. package/rules/ruff-e742-ambiguous-class-name.json +2 -2
  84. package/rules/ruff-e743-ambiguous-function-name.json +2 -2
  85. package/rules/ruff-f403-undefined-local-with-import-star.json +1 -1
  86. package/rules/ruff-f405-undefined-local-with-import-star-usage.json +2 -2
  87. package/rules/ruff-f406-undefined-local-with-nested-import-star-usage.json +2 -2
  88. package/rules/ruff-f407-future-feature-not-defined.json +1 -1
  89. package/rules/ruff-f501-percent-format-invalid-format.json +2 -2
  90. package/rules/ruff-f502-percent-format-expected-mapping.json +1 -1
  91. package/rules/ruff-f503-percent-format-expected-sequence.json +1 -1
  92. package/rules/ruff-f504-percent-format-extra-named-arguments.json +1 -1
  93. package/rules/ruff-f505-percent-format-missing-argument.json +1 -1
  94. package/rules/ruff-f506-percent-format-mixed-positional-and-named.json +2 -2
  95. package/rules/ruff-f507-percent-format-positional-count-mismatch.json +2 -2
  96. package/rules/ruff-f508-percent-format-star-requires-sequence.json +2 -2
  97. package/rules/ruff-f509-percent-format-unsupported-format-character.json +2 -2
  98. package/rules/ruff-f521-string-dot-format-invalid-format.json +1 -1
  99. package/rules/ruff-f522-string-dot-format-extra-named-arguments.json +2 -2
  100. package/rules/ruff-f523-string-dot-format-extra-positional-arguments.json +1 -1
  101. package/rules/ruff-f524-string-dot-format-missing-arguments.json +1 -1
  102. package/rules/ruff-f525-string-dot-format-mixing-automatic.json +1 -1
  103. package/rules/ruff-f541-f-string-missing-placeholders.json +2 -2
  104. package/rules/ruff-f601-multi-value-repeated-key-literal.json +1 -1
  105. package/rules/ruff-f602-multi-value-repeated-key-variable.json +2 -2
  106. package/rules/ruff-f622-multiple-starred-expressions.json +1 -1
  107. package/rules/ruff-f632-is-literal.json +1 -1
  108. package/rules/ruff-f633-invalid-print-syntax.json +2 -2
  109. package/rules/ruff-f701-break-outside-loop.json +1 -1
  110. package/rules/ruff-f702-continue-outside-loop.json +1 -1
  111. package/rules/ruff-f706-return-outside-function.json +1 -1
  112. package/rules/ruff-f707-default-except-not-last.json +1 -1
  113. package/rules/ruff-f822-undefined-export.json +1 -1
  114. package/rules/ruff-f823-undefined-local.json +2 -2
  115. package/rules/ruff-f842-unused-annotation.json +1 -1
  116. package/rules/ruff-f901-raise-not-implemented.json +1 -1
  117. package/rules/ruff-pie794-duplicate-class-field-definition.json +1 -1
  118. package/rules/ruff-pie796-non-unique-enums.json +1 -1
  119. package/rules/ruff-pie800-unnecessary-spread.json +1 -1
  120. package/rules/ruff-pie804-unnecessary-dict-kwargs.json +1 -1
  121. package/rules/ruff-pie807-reimplemented-container-builtin.json +1 -1
  122. package/rules/ruff-pie810-multiple-starts-ends-with.json +2 -2
  123. package/rules/ruff-ret501-unnecessary-return-none.json +1 -1
  124. package/rules/ruff-ret502-implicit-return-value.json +2 -2
  125. package/rules/ruff-ret505-superfluous-else-return.json +1 -1
  126. package/rules/ruff-ret506-superfluous-else-raise.json +1 -1
  127. package/rules/ruff-ret507-superfluous-else-continue.json +1 -1
  128. package/rules/ruff-ret508-superfluous-else-break.json +1 -1
  129. package/rules/ruff-sim101-duplicate-isinstance-call.json +1 -1
  130. package/rules/ruff-sim107-return-in-try-except-finally.json +2 -2
  131. package/rules/ruff-sim109-compare-with-tuple.json +1 -1
  132. package/rules/ruff-sim112-uncapitalized-environment-variables.json +2 -2
  133. package/rules/ruff-sim113-enumerate-for-loop.json +1 -1
  134. package/rules/ruff-sim208-double-negation.json +1 -1
  135. package/rules/ruff-sim210-if-expr-with-true-false.json +1 -1
  136. package/rules/ruff-sim211-if-expr-with-false-true.json +1 -1
  137. package/rules/ruff-sim212-if-expr-with-twisted-arms.json +2 -2
  138. package/rules/ruff-sim300-yoda-conditions.json +2 -2
  139. package/rules/ruff-sim905-split-static-string.json +1 -1
  140. package/rules/ruff-sim910-dict-get-with-none-default.json +1 -1
  141. package/rules/ruff-t100-debugger.json +3 -3
  142. package/rules/bandit-b406-import-xml-sax.json +0 -73
  143. package/rules/bandit-b610-django-extra-used.json +0 -268
  144. package/rules/ruff-f722-forward-annotation-syntax-error.json +0 -654
@@ -1,654 +0,0 @@
1
- {
2
- "format": "rerail.policy/v1",
3
- "id": "ruff-f722-forward-annotation-syntax-error",
4
- "revision": 2,
5
- "mode": "steer",
6
- "description": "Port of Ruff's F722 (forward-annotation-syntax-error) with default settings: a string Ruff parses as a type definition (a string annotation, a `type` value, a `cast`/`TypeVar` argument, a typing generic's `\"...\"` slice), read with the `annotation` grammar. Three checks: a string Ruff's parser refuses (the parse is one `ERROR` node), reported on the string; each semantic syntax error Ruff's checker reports in a string it parsed (`await` or `yield` outside a function, a walrus rebinding a comprehension variable, duplicate arguments, `__debug__` stored, a name used before its `global`, ...: an `ERROR` node after the expression), reported at the offending node; and Ruff's second error on an `await` evaluated outside any function (\"`await` statement outside of a function\": the string's host is not in a function body with no class between them, and the `await` is not in a lambda's body or a generator expression's element, conditions or later iterables), at the `await`. Strings nested in one (`List['a b']` inside a string annotation) are read too. Not inside a function decorated with a `no_type_check` that resolves to `typing`, `_typeshed` or `typing_extensions` (Ruff's match_typing_expr): its parameters, defaults, return annotation and body. Ported from the Ruff conformance suite (rerail/conformance/ruff/rules/F722.json at 3f102adcb), with Ruff's `# noqa` honoured as the Ruff CLI honours it. Divergence: a string after the first element of a subscript whose generic resolves to a jaxtyping import (`Float[Array, \"b n\"]`, `jaxtyping.Float[...]`, `jt.Shaped[...]`) is a jaxtyping shape, which jaxtyping parses with its own grammar, not a forward annotation, so it is not reported. Ruff 0.16.9 reports it (NER-1827). A shape inside a string annotation (`\"Float[Array, 'b n']\"`) is still reported.",
7
- "scope": {
8
- "include": [
9
- "**/*"
10
- ],
11
- "exclude": []
12
- },
13
- "clauses": [
14
- {
15
- "id": "forward-annotation-syntax-error",
16
- "forbid": {
17
- "ast": {
18
- "language": "python",
19
- "utils": {
20
- "error-within": {
21
- "parse": {
22
- "grammar": "annotation",
23
- "has": {
24
- "stopBy": "end",
25
- "any": [
26
- {
27
- "all": [
28
- {
29
- "any": [
30
- {
31
- "kind": "string"
32
- },
33
- {
34
- "kind": "concatenated_string"
35
- }
36
- ]
37
- },
38
- {
39
- "parse": {
40
- "grammar": "annotation",
41
- "kind": "ERROR"
42
- }
43
- }
44
- ],
45
- "capture": "C"
46
- },
47
- {
48
- "all": [
49
- {
50
- "any": [
51
- {
52
- "kind": "string"
53
- },
54
- {
55
- "kind": "concatenated_string"
56
- }
57
- ]
58
- },
59
- {
60
- "matches": "error-within"
61
- }
62
- ]
63
- }
64
- ]
65
- }
66
- }
67
- },
68
- "jaxtyping-shape": {
69
- "any": [
70
- {
71
- "follows": {
72
- "stopBy": "neighbor",
73
- "regex": "^,$"
74
- },
75
- "inside": {
76
- "stopBy": "neighbor",
77
- "kind": "subscript",
78
- "has": {
79
- "field": "value",
80
- "any": [
81
- {
82
- "kind": "identifier"
83
- },
84
- {
85
- "kind": "attribute"
86
- }
87
- ],
88
- "resolves": {
89
- "import": [
90
- "jaxtyping"
91
- ],
92
- "prefix": true
93
- }
94
- }
95
- }
96
- },
97
- {
98
- "inside": {
99
- "stopBy": "neighbor",
100
- "kind": "type",
101
- "follows": {
102
- "stopBy": "neighbor",
103
- "regex": "^,$"
104
- },
105
- "inside": {
106
- "stopBy": "neighbor",
107
- "kind": "type_parameter",
108
- "inside": {
109
- "stopBy": "neighbor",
110
- "kind": "generic_type",
111
- "has": {
112
- "stopBy": "neighbor",
113
- "any": [
114
- {
115
- "kind": "identifier"
116
- },
117
- {
118
- "kind": "attribute"
119
- }
120
- ],
121
- "resolves": {
122
- "import": [
123
- "jaxtyping"
124
- ],
125
- "prefix": true
126
- }
127
- }
128
- }
129
- }
130
- }
131
- }
132
- ]
133
- }
134
- },
135
- "rule": {
136
- "all": [
137
- {
138
- "any": [
139
- {
140
- "kind": "string"
141
- },
142
- {
143
- "kind": "concatenated_string"
144
- }
145
- ]
146
- },
147
- {
148
- "any": [
149
- {
150
- "parse": {
151
- "grammar": "annotation",
152
- "kind": "ERROR"
153
- },
154
- "pattern": "$C"
155
- },
156
- {
157
- "matches": "error-within"
158
- }
159
- ]
160
- }
161
- ],
162
- "not": {
163
- "any": [
164
- {
165
- "inside": {
166
- "stopBy": "end",
167
- "kind": "function_definition",
168
- "inside": {
169
- "stopBy": "neighbor",
170
- "kind": "decorated_definition",
171
- "has": {
172
- "stopBy": "neighbor",
173
- "kind": "decorator",
174
- "has": {
175
- "stopBy": "neighbor",
176
- "any": [
177
- {
178
- "kind": "identifier"
179
- },
180
- {
181
- "kind": "attribute"
182
- }
183
- ],
184
- "resolves": {
185
- "import": [
186
- "typing.no_type_check",
187
- "_typeshed.no_type_check",
188
- "typing_extensions.no_type_check"
189
- ]
190
- }
191
- }
192
- }
193
- }
194
- }
195
- },
196
- {
197
- "matches": "jaxtyping-shape"
198
- }
199
- ]
200
- }
201
- }
202
- }
203
- },
204
- "violation": {
205
- "anchor": "capture.C",
206
- "code": "F722",
207
- "message": "Syntax error in forward annotation",
208
- "each": "C",
209
- "suppress": {
210
- "noqa": {
211
- "codes": [
212
- "F722"
213
- ]
214
- }
215
- }
216
- }
217
- },
218
- {
219
- "id": "forward-annotation-semantic-syntax-error",
220
- "forbid": {
221
- "ast": {
222
- "language": "python",
223
- "utils": {
224
- "semantic-error-within": {
225
- "parse": {
226
- "grammar": "annotation",
227
- "has": {
228
- "stopBy": "end",
229
- "all": [
230
- {
231
- "any": [
232
- {
233
- "kind": "string"
234
- },
235
- {
236
- "kind": "concatenated_string"
237
- }
238
- ]
239
- },
240
- {
241
- "matches": "semantic-error"
242
- }
243
- ]
244
- }
245
- }
246
- },
247
- "semantic-error": {
248
- "any": [
249
- {
250
- "parse": {
251
- "grammar": "annotation",
252
- "has": {
253
- "kind": "ERROR",
254
- "capture": "E"
255
- }
256
- }
257
- },
258
- {
259
- "matches": "semantic-error-within"
260
- }
261
- ]
262
- },
263
- "jaxtyping-shape": {
264
- "any": [
265
- {
266
- "follows": {
267
- "stopBy": "neighbor",
268
- "regex": "^,$"
269
- },
270
- "inside": {
271
- "stopBy": "neighbor",
272
- "kind": "subscript",
273
- "has": {
274
- "field": "value",
275
- "any": [
276
- {
277
- "kind": "identifier"
278
- },
279
- {
280
- "kind": "attribute"
281
- }
282
- ],
283
- "resolves": {
284
- "import": [
285
- "jaxtyping"
286
- ],
287
- "prefix": true
288
- }
289
- }
290
- }
291
- },
292
- {
293
- "inside": {
294
- "stopBy": "neighbor",
295
- "kind": "type",
296
- "follows": {
297
- "stopBy": "neighbor",
298
- "regex": "^,$"
299
- },
300
- "inside": {
301
- "stopBy": "neighbor",
302
- "kind": "type_parameter",
303
- "inside": {
304
- "stopBy": "neighbor",
305
- "kind": "generic_type",
306
- "has": {
307
- "stopBy": "neighbor",
308
- "any": [
309
- {
310
- "kind": "identifier"
311
- },
312
- {
313
- "kind": "attribute"
314
- }
315
- ],
316
- "resolves": {
317
- "import": [
318
- "jaxtyping"
319
- ],
320
- "prefix": true
321
- }
322
- }
323
- }
324
- }
325
- }
326
- }
327
- ]
328
- }
329
- },
330
- "rule": {
331
- "all": [
332
- {
333
- "any": [
334
- {
335
- "kind": "string"
336
- },
337
- {
338
- "kind": "concatenated_string"
339
- }
340
- ]
341
- },
342
- {
343
- "matches": "semantic-error"
344
- }
345
- ],
346
- "not": {
347
- "any": [
348
- {
349
- "inside": {
350
- "stopBy": "end",
351
- "kind": "function_definition",
352
- "inside": {
353
- "stopBy": "neighbor",
354
- "kind": "decorated_definition",
355
- "has": {
356
- "stopBy": "neighbor",
357
- "kind": "decorator",
358
- "has": {
359
- "stopBy": "neighbor",
360
- "any": [
361
- {
362
- "kind": "identifier"
363
- },
364
- {
365
- "kind": "attribute"
366
- }
367
- ],
368
- "resolves": {
369
- "import": [
370
- "typing.no_type_check",
371
- "_typeshed.no_type_check",
372
- "typing_extensions.no_type_check"
373
- ]
374
- }
375
- }
376
- }
377
- }
378
- }
379
- },
380
- {
381
- "matches": "jaxtyping-shape"
382
- }
383
- ]
384
- }
385
- }
386
- }
387
- },
388
- "violation": {
389
- "anchor": "capture.E",
390
- "code": "F722",
391
- "message": "Syntax error in forward annotation",
392
- "each": "E",
393
- "suppress": {
394
- "noqa": {
395
- "codes": [
396
- "F722"
397
- ]
398
- }
399
- }
400
- }
401
- },
402
- {
403
- "id": "forward-annotation-await-outside-function",
404
- "forbid": {
405
- "ast": {
406
- "language": "python",
407
- "utils": {
408
- "await-outside-function-within": {
409
- "parse": {
410
- "grammar": "annotation",
411
- "has": {
412
- "stopBy": "end",
413
- "all": [
414
- {
415
- "any": [
416
- {
417
- "kind": "string"
418
- },
419
- {
420
- "kind": "concatenated_string"
421
- }
422
- ]
423
- },
424
- {
425
- "matches": "await-outside-function"
426
- }
427
- ]
428
- }
429
- }
430
- },
431
- "await-outside-function": {
432
- "any": [
433
- {
434
- "parse": {
435
- "grammar": "annotation",
436
- "has": {
437
- "stopBy": "end",
438
- "kind": "await",
439
- "not": {
440
- "any": [
441
- {
442
- "matches": "function-scoped"
443
- },
444
- {
445
- "inside": {
446
- "stopBy": "end",
447
- "matches": "function-scoped"
448
- }
449
- }
450
- ]
451
- },
452
- "capture": "A"
453
- }
454
- }
455
- },
456
- {
457
- "matches": "await-outside-function-within"
458
- }
459
- ]
460
- },
461
- "function-scoped": {
462
- "any": [
463
- {
464
- "follows": {
465
- "stopBy": "end",
466
- "regex": "^:$"
467
- },
468
- "inside": {
469
- "stopBy": "neighbor",
470
- "kind": "lambda"
471
- }
472
- },
473
- {
474
- "precedes": {
475
- "stopBy": "end",
476
- "kind": "for_in_clause"
477
- },
478
- "inside": {
479
- "stopBy": "neighbor",
480
- "kind": "generator_expression"
481
- }
482
- },
483
- {
484
- "kind": "if_clause",
485
- "inside": {
486
- "stopBy": "neighbor",
487
- "kind": "generator_expression"
488
- }
489
- },
490
- {
491
- "kind": "for_in_clause",
492
- "inside": {
493
- "stopBy": "neighbor",
494
- "kind": "generator_expression"
495
- },
496
- "follows": {
497
- "stopBy": "end",
498
- "kind": "for_in_clause"
499
- }
500
- }
501
- ]
502
- },
503
- "jaxtyping-shape": {
504
- "any": [
505
- {
506
- "follows": {
507
- "stopBy": "neighbor",
508
- "regex": "^,$"
509
- },
510
- "inside": {
511
- "stopBy": "neighbor",
512
- "kind": "subscript",
513
- "has": {
514
- "field": "value",
515
- "any": [
516
- {
517
- "kind": "identifier"
518
- },
519
- {
520
- "kind": "attribute"
521
- }
522
- ],
523
- "resolves": {
524
- "import": [
525
- "jaxtyping"
526
- ],
527
- "prefix": true
528
- }
529
- }
530
- }
531
- },
532
- {
533
- "inside": {
534
- "stopBy": "neighbor",
535
- "kind": "type",
536
- "follows": {
537
- "stopBy": "neighbor",
538
- "regex": "^,$"
539
- },
540
- "inside": {
541
- "stopBy": "neighbor",
542
- "kind": "type_parameter",
543
- "inside": {
544
- "stopBy": "neighbor",
545
- "kind": "generic_type",
546
- "has": {
547
- "stopBy": "neighbor",
548
- "any": [
549
- {
550
- "kind": "identifier"
551
- },
552
- {
553
- "kind": "attribute"
554
- }
555
- ],
556
- "resolves": {
557
- "import": [
558
- "jaxtyping"
559
- ],
560
- "prefix": true
561
- }
562
- }
563
- }
564
- }
565
- }
566
- }
567
- ]
568
- }
569
- },
570
- "rule": {
571
- "all": [
572
- {
573
- "any": [
574
- {
575
- "kind": "string"
576
- },
577
- {
578
- "kind": "concatenated_string"
579
- }
580
- ]
581
- },
582
- {
583
- "matches": "await-outside-function"
584
- },
585
- {
586
- "not": {
587
- "inside": {
588
- "stopBy": {
589
- "kind": "class_definition"
590
- },
591
- "kind": "function_definition",
592
- "field": "body"
593
- }
594
- }
595
- }
596
- ],
597
- "not": {
598
- "any": [
599
- {
600
- "inside": {
601
- "stopBy": "end",
602
- "kind": "function_definition",
603
- "inside": {
604
- "stopBy": "neighbor",
605
- "kind": "decorated_definition",
606
- "has": {
607
- "stopBy": "neighbor",
608
- "kind": "decorator",
609
- "has": {
610
- "stopBy": "neighbor",
611
- "any": [
612
- {
613
- "kind": "identifier"
614
- },
615
- {
616
- "kind": "attribute"
617
- }
618
- ],
619
- "resolves": {
620
- "import": [
621
- "typing.no_type_check",
622
- "_typeshed.no_type_check",
623
- "typing_extensions.no_type_check"
624
- ]
625
- }
626
- }
627
- }
628
- }
629
- }
630
- },
631
- {
632
- "matches": "jaxtyping-shape"
633
- }
634
- ]
635
- }
636
- }
637
- }
638
- },
639
- "violation": {
640
- "anchor": "capture.A",
641
- "code": "F722",
642
- "message": "Syntax error in forward annotation",
643
- "each": "A",
644
- "suppress": {
645
- "noqa": {
646
- "codes": [
647
- "F722"
648
- ]
649
- }
650
- }
651
- }
652
- }
653
- ]
654
- }