@neralabs/rerail-pack-python 0.1.1

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