@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,562 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "ruff-sim113-enumerate-for-loop",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Port of Ruff's SIM113 (enumerate-for-loop): `N += 1` as a top-level statement of a non-async `for` body without `continue`, where the binding `N` reads (`resolves.binding`) is a name assignment of `0` (plain, annotated, or an unpacked element of a display, paired by index as Ruff's match_value where the engine gives no value) whose parent statement is the loop's, `N` is bound only once inside the loop (`binds` with `bindings` within the loop: deletions and comprehension walruses count, comprehension targets, nested functions' locals and keyword arguments do not), and no load of `N` outside the loop in its scope, at or after the initial assignment, reads the initial binding (whose references Ruff's rebinding inherits) or a binding inside the loop. The loop and the initial assignment are found again by node identity (`compare` with `text: \"node\"`), so identical loops in one scope stay apart.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "enumerate-for-loop",
16
+ "forbid": {
17
+ "ast": {
18
+ "language": "python",
19
+ "utils": {
20
+ "one": {
21
+ "any": [
22
+ {
23
+ "kind": "integer",
24
+ "value": {
25
+ "type": "int",
26
+ "eq": 1
27
+ }
28
+ },
29
+ {
30
+ "kind": "parenthesized_expression",
31
+ "has": {
32
+ "stopBy": "neighbor",
33
+ "matches": "one"
34
+ }
35
+ }
36
+ ]
37
+ },
38
+ "zero": {
39
+ "any": [
40
+ {
41
+ "kind": "integer",
42
+ "value": {
43
+ "type": "int",
44
+ "eq": 0
45
+ }
46
+ },
47
+ {
48
+ "kind": "parenthesized_expression",
49
+ "has": {
50
+ "stopBy": "neighbor",
51
+ "matches": "zero"
52
+ }
53
+ }
54
+ ]
55
+ },
56
+ "statement": {
57
+ "any": [
58
+ {
59
+ "any": [
60
+ {
61
+ "kind": "expression_statement"
62
+ },
63
+ {
64
+ "kind": "return_statement"
65
+ },
66
+ {
67
+ "kind": "with_statement"
68
+ },
69
+ {
70
+ "kind": "if_statement"
71
+ },
72
+ {
73
+ "kind": "for_statement"
74
+ },
75
+ {
76
+ "kind": "while_statement"
77
+ },
78
+ {
79
+ "kind": "try_statement"
80
+ },
81
+ {
82
+ "kind": "function_definition"
83
+ },
84
+ {
85
+ "kind": "class_definition"
86
+ },
87
+ {
88
+ "kind": "decorated_definition"
89
+ },
90
+ {
91
+ "kind": "assert_statement"
92
+ },
93
+ {
94
+ "kind": "raise_statement"
95
+ },
96
+ {
97
+ "kind": "delete_statement"
98
+ },
99
+ {
100
+ "kind": "pass_statement"
101
+ },
102
+ {
103
+ "kind": "break_statement"
104
+ },
105
+ {
106
+ "kind": "continue_statement"
107
+ },
108
+ {
109
+ "kind": "global_statement"
110
+ },
111
+ {
112
+ "kind": "nonlocal_statement"
113
+ },
114
+ {
115
+ "kind": "import_statement"
116
+ },
117
+ {
118
+ "kind": "import_from_statement"
119
+ },
120
+ {
121
+ "kind": "future_import_statement"
122
+ },
123
+ {
124
+ "kind": "print_statement"
125
+ },
126
+ {
127
+ "kind": "exec_statement"
128
+ },
129
+ {
130
+ "kind": "type_alias_statement"
131
+ },
132
+ {
133
+ "kind": "match_statement"
134
+ }
135
+ ]
136
+ },
137
+ {
138
+ "kind": "module"
139
+ }
140
+ ]
141
+ },
142
+ "initial-site": {
143
+ "kind": "assignment",
144
+ "inside": {
145
+ "stopBy": {
146
+ "kind": "expression_statement"
147
+ },
148
+ "kind": "expression_statement",
149
+ "inside": {
150
+ "stopBy": {
151
+ "matches": "statement"
152
+ },
153
+ "matches": "statement",
154
+ "has": {
155
+ "stopBy": {
156
+ "not": {
157
+ "any": [
158
+ {
159
+ "kind": "block"
160
+ },
161
+ {
162
+ "kind": "elif_clause"
163
+ },
164
+ {
165
+ "kind": "else_clause"
166
+ },
167
+ {
168
+ "kind": "except_clause"
169
+ },
170
+ {
171
+ "kind": "finally_clause"
172
+ },
173
+ {
174
+ "kind": "case_clause"
175
+ }
176
+ ]
177
+ }
178
+ },
179
+ "kind": "for_statement",
180
+ "pattern": "$L1",
181
+ "compare": {
182
+ "left": "L1",
183
+ "op": "eq",
184
+ "right": "LOOP",
185
+ "text": "node"
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "not": {
191
+ "inside": {
192
+ "stopBy": {
193
+ "matches": "scope-root"
194
+ },
195
+ "matches": "scope-root",
196
+ "has": {
197
+ "stopBy": {
198
+ "any": [
199
+ {
200
+ "kind": "function_definition"
201
+ },
202
+ {
203
+ "kind": "class_definition"
204
+ }
205
+ ]
206
+ },
207
+ "any": [
208
+ {
209
+ "any": [
210
+ {
211
+ "kind": "global_statement"
212
+ },
213
+ {
214
+ "kind": "nonlocal_statement"
215
+ }
216
+ ]
217
+ }
218
+ ],
219
+ "has": {
220
+ "stopBy": "neighbor",
221
+ "kind": "identifier",
222
+ "pattern": "$N"
223
+ }
224
+ }
225
+ }
226
+ }
227
+ },
228
+ "scope-root": {
229
+ "any": [
230
+ {
231
+ "kind": "module"
232
+ },
233
+ {
234
+ "kind": "block",
235
+ "inside": {
236
+ "stopBy": "neighbor",
237
+ "any": [
238
+ {
239
+ "kind": "function_definition"
240
+ },
241
+ {
242
+ "kind": "class_definition"
243
+ }
244
+ ]
245
+ }
246
+ }
247
+ ]
248
+ },
249
+ "later-load": {
250
+ "inside": {
251
+ "stopBy": {
252
+ "matches": "scope-root"
253
+ },
254
+ "matches": "scope-root",
255
+ "has": {
256
+ "stopBy": "end",
257
+ "kind": "identifier",
258
+ "pattern": "$N",
259
+ "not": {
260
+ "inside": {
261
+ "stopBy": "end",
262
+ "kind": "for_statement",
263
+ "pattern": "$L2",
264
+ "compare": {
265
+ "left": "L2",
266
+ "op": "eq",
267
+ "right": "LOOP",
268
+ "text": "node"
269
+ }
270
+ }
271
+ },
272
+ "any": [
273
+ {
274
+ "follows": {
275
+ "stopBy": "end",
276
+ "kind": "expression_statement",
277
+ "has": {
278
+ "stopBy": "neighbor",
279
+ "pattern": "$S4",
280
+ "compare": {
281
+ "left": "S4",
282
+ "op": "eq",
283
+ "right": "INIT",
284
+ "text": "node"
285
+ }
286
+ }
287
+ }
288
+ },
289
+ {
290
+ "inside": {
291
+ "stopBy": "end",
292
+ "follows": {
293
+ "stopBy": "end",
294
+ "kind": "expression_statement",
295
+ "has": {
296
+ "stopBy": "neighbor",
297
+ "pattern": "$S4",
298
+ "compare": {
299
+ "left": "S4",
300
+ "op": "eq",
301
+ "right": "INIT",
302
+ "text": "node"
303
+ }
304
+ }
305
+ }
306
+ }
307
+ }
308
+ ],
309
+ "resolves": {
310
+ "binding": {
311
+ "site": {
312
+ "any": [
313
+ {
314
+ "pattern": "$S",
315
+ "compare": {
316
+ "left": "S",
317
+ "op": "eq",
318
+ "right": "INIT",
319
+ "text": "node"
320
+ }
321
+ },
322
+ {
323
+ "inside": {
324
+ "stopBy": {
325
+ "matches": "scope-root"
326
+ },
327
+ "kind": "for_statement",
328
+ "pattern": "$L3",
329
+ "compare": {
330
+ "left": "L3",
331
+ "op": "eq",
332
+ "right": "LOOP",
333
+ "text": "node"
334
+ }
335
+ }
336
+ }
337
+ ]
338
+ }
339
+ }
340
+ }
341
+ }
342
+ }
343
+ }
344
+ },
345
+ "rule": {
346
+ "kind": "augmented_assignment",
347
+ "has": {
348
+ "stopBy": "neighbor",
349
+ "regex": "^\\+=$"
350
+ },
351
+ "all": [
352
+ {
353
+ "has": {
354
+ "stopBy": "neighbor",
355
+ "kind": "identifier",
356
+ "pattern": "$N",
357
+ "precedes": {
358
+ "stopBy": "neighbor",
359
+ "regex": "^\\+=$"
360
+ }
361
+ }
362
+ },
363
+ {
364
+ "has": {
365
+ "stopBy": "neighbor",
366
+ "kind": "identifier",
367
+ "pattern": "$N",
368
+ "precedes": {
369
+ "stopBy": "neighbor",
370
+ "regex": "^\\+=$"
371
+ },
372
+ "resolves": {
373
+ "binding": {
374
+ "site": {
375
+ "pattern": "$INIT"
376
+ }
377
+ }
378
+ }
379
+ }
380
+ },
381
+ {
382
+ "has": {
383
+ "stopBy": "neighbor",
384
+ "matches": "one",
385
+ "follows": {
386
+ "stopBy": "neighbor",
387
+ "regex": "^\\+=$"
388
+ }
389
+ }
390
+ },
391
+ {
392
+ "inside": {
393
+ "stopBy": "neighbor",
394
+ "kind": "expression_statement",
395
+ "inside": {
396
+ "stopBy": "neighbor",
397
+ "kind": "block",
398
+ "inside": {
399
+ "stopBy": "neighbor",
400
+ "kind": "for_statement",
401
+ "pattern": "$LOOP",
402
+ "not": {
403
+ "any": [
404
+ {
405
+ "has": {
406
+ "stopBy": "neighbor",
407
+ "regex": "^async$"
408
+ }
409
+ },
410
+ {
411
+ "has": {
412
+ "stopBy": "neighbor",
413
+ "kind": "block",
414
+ "has": {
415
+ "stopBy": {
416
+ "any": [
417
+ {
418
+ "kind": "function_definition"
419
+ },
420
+ {
421
+ "kind": "class_definition"
422
+ }
423
+ ]
424
+ },
425
+ "kind": "continue_statement"
426
+ }
427
+ }
428
+ },
429
+ {
430
+ "matches": "later-load"
431
+ }
432
+ ]
433
+ }
434
+ }
435
+ }
436
+ }
437
+ },
438
+ {
439
+ "has": {
440
+ "stopBy": "neighbor",
441
+ "kind": "identifier",
442
+ "pattern": "$N",
443
+ "precedes": {
444
+ "stopBy": "neighbor",
445
+ "regex": "^\\+=$"
446
+ },
447
+ "binds": {
448
+ "form": "augmented",
449
+ "bindings": {
450
+ "within": "LOOP",
451
+ "max": 1
452
+ }
453
+ }
454
+ }
455
+ },
456
+ {
457
+ "has": {
458
+ "stopBy": "neighbor",
459
+ "kind": "identifier",
460
+ "pattern": "$N",
461
+ "precedes": {
462
+ "stopBy": "neighbor",
463
+ "regex": "^\\+=$"
464
+ },
465
+ "any": [
466
+ {
467
+ "resolves": {
468
+ "binding": {
469
+ "value": {
470
+ "matches": "zero"
471
+ },
472
+ "site": {
473
+ "matches": "initial-site"
474
+ }
475
+ }
476
+ }
477
+ },
478
+ {
479
+ "resolves": {
480
+ "binding": {
481
+ "site": {
482
+ "matches": "initial-site",
483
+ "all": [
484
+ {
485
+ "kind": "assignment",
486
+ "all": [
487
+ {
488
+ "has": {
489
+ "field": "left",
490
+ "has": {
491
+ "stopBy": "neighbor",
492
+ "kind": "identifier",
493
+ "pattern": "$UT",
494
+ "compare": {
495
+ "left": "UT",
496
+ "op": "eq",
497
+ "right": "N",
498
+ "text": "tokens"
499
+ },
500
+ "not": {
501
+ "precedes": {
502
+ "stopBy": "end",
503
+ "kind": "identifier",
504
+ "pattern": "$UU",
505
+ "compare": {
506
+ "left": "UU",
507
+ "op": "eq",
508
+ "right": "N",
509
+ "text": "tokens"
510
+ }
511
+ }
512
+ }
513
+ }
514
+ }
515
+ },
516
+ {
517
+ "has": {
518
+ "field": "right",
519
+ "has": {
520
+ "stopBy": "neighbor",
521
+ "matches": "zero",
522
+ "pattern": "$UV"
523
+ }
524
+ }
525
+ },
526
+ {
527
+ "compare": {
528
+ "left": "UV",
529
+ "op": "eq",
530
+ "right": "UT",
531
+ "text": "index"
532
+ }
533
+ }
534
+ ]
535
+ }
536
+ ]
537
+ }
538
+ }
539
+ }
540
+ }
541
+ ]
542
+ }
543
+ }
544
+ ]
545
+ }
546
+ }
547
+ },
548
+ "violation": {
549
+ "anchor": "witness.span",
550
+ "code": "SIM113",
551
+ "message": "Use `enumerate()` for index variable `$N` in `for` loop",
552
+ "suppress": {
553
+ "noqa": {
554
+ "codes": [
555
+ "SIM113"
556
+ ]
557
+ }
558
+ }
559
+ }
560
+ }
561
+ ]
562
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "ruff-sim208-double-negation",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Port of Ruff's SIM208 (double-negation): `not` applied to another `not` expression, through any parentheses, reported on the outer `not` expression (each outer `not` of a longer chain).",
7
+ "scope": {
8
+ "include": [
9
+ "**/*"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "double-negation",
16
+ "forbid": {
17
+ "ast": {
18
+ "language": "python",
19
+ "utils": {
20
+ "negation": {
21
+ "any": [
22
+ {
23
+ "kind": "not_operator"
24
+ },
25
+ {
26
+ "kind": "parenthesized_expression",
27
+ "has": {
28
+ "stopBy": "neighbor",
29
+ "matches": "negation"
30
+ }
31
+ }
32
+ ]
33
+ }
34
+ },
35
+ "rule": {
36
+ "kind": "not_operator",
37
+ "has": {
38
+ "stopBy": "neighbor",
39
+ "matches": "negation"
40
+ }
41
+ }
42
+ }
43
+ },
44
+ "violation": {
45
+ "anchor": "witness.span",
46
+ "code": "SIM208",
47
+ "message": "Use the operand instead of `not (not ...)`",
48
+ "suppress": {
49
+ "noqa": {
50
+ "codes": [
51
+ "SIM208"
52
+ ]
53
+ }
54
+ }
55
+ }
56
+ }
57
+ ]
58
+ }