@neralabs/rerail-pack-python 0.1.3 → 0.1.5

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 (139) hide show
  1. package/README.md +713 -6
  2. package/licenses/ruff/UPSTREAM.md +3 -3
  3. package/package.json +1 -1
  4. package/rules/bandit-b101-assert-used.json +2 -2
  5. package/rules/bandit-b102-exec-used.json +2 -2
  6. package/rules/bandit-b110-try-except-pass.json +1 -1
  7. package/rules/bandit-b112-try-except-continue.json +1 -1
  8. package/rules/bandit-b113-request-without-timeout.json +2 -2
  9. package/rules/bandit-b301-pickle.json +2 -2
  10. package/rules/bandit-b302-marshal.json +2 -2
  11. package/rules/bandit-b303-md5.json +1 -1
  12. package/rules/bandit-b305-cipher-modes.json +2 -2
  13. package/rules/bandit-b306-mktemp-q.json +2 -2
  14. package/rules/bandit-b307-eval.json +1 -1
  15. package/rules/bandit-b308-mark-safe.json +2 -2
  16. package/rules/bandit-b310-urllib-urlopen.json +1 -1
  17. package/rules/bandit-b311-random.json +1 -1
  18. package/rules/bandit-b312-telnetlib.json +1 -1
  19. package/rules/bandit-b313-xml-bad-celementtree.json +1 -1
  20. package/rules/bandit-b314-xml-bad-elementtree.json +1 -1
  21. package/rules/bandit-b315-xml-bad-expatreader.json +1 -1
  22. package/rules/bandit-b316-xml-bad-expatbuilder.json +1 -1
  23. package/rules/bandit-b317-xml-bad-sax.json +1 -1
  24. package/rules/bandit-b318-xml-bad-minidom.json +1 -1
  25. package/rules/bandit-b319-xml-bad-pulldom.json +1 -1
  26. package/rules/bandit-b321-ftplib.json +2 -2
  27. package/rules/bandit-b323-unverified-context.json +2 -2
  28. package/rules/bandit-b401-import-telnetlib.json +2 -2
  29. package/rules/bandit-b402-import-ftplib.json +2 -2
  30. package/rules/bandit-b405-import-xml-etree.json +1 -1
  31. package/rules/bandit-b407-import-xml-expat.json +1 -1
  32. package/rules/bandit-b408-import-xml-minidom.json +1 -1
  33. package/rules/bandit-b409-import-xml-pulldom.json +1 -1
  34. package/rules/bandit-b411-import-xmlrpclib.json +1 -1
  35. package/rules/bandit-b413-import-pycrypto.json +1 -1
  36. package/rules/bandit-b415-import-pyghmi.json +2 -2
  37. package/rules/bandit-b502-ssl-with-bad-version.json +2 -2
  38. package/rules/bandit-b505-weak-cryptographic-key.json +2 -2
  39. package/rules/bandit-b507-ssh-no-host-key-verification.json +2 -2
  40. package/rules/bandit-b606-start-process-with-no-shell.json +2 -2
  41. package/rules/bandit-b615-huggingface-unsafe-download.json +2 -2
  42. package/rules/ruff-async100-cancel-scope-no-checkpoint.json +2 -2
  43. package/rules/ruff-async105-trio-sync-call.json +1 -1
  44. package/rules/ruff-async115-async-zero-sleep.json +1 -1
  45. package/rules/ruff-async116-long-sleep-not-forever.json +1 -1
  46. package/rules/ruff-async210-blocking-http-call-in-async-function.json +3 -3
  47. package/rules/ruff-async221-run-process-in-async-function.json +1 -1
  48. package/rules/ruff-async222-wait-for-process-in-async-function.json +3 -3
  49. package/rules/ruff-async230-blocking-open-call-in-async-function.json +2 -2
  50. package/rules/ruff-async250-blocking-input-in-async-function.json +2 -2
  51. package/rules/ruff-async251-blocking-sleep-in-async-function.json +1 -1
  52. package/rules/ruff-b002-unary-prefix-increment-decrement.json +3 -3
  53. package/rules/ruff-b003-assignment-to-os-environ.json +2 -2
  54. package/rules/ruff-b004-unreliable-callable-check.json +1 -1
  55. package/rules/ruff-b005-strip-with-multi-characters.json +2 -2
  56. package/rules/ruff-b007-unused-loop-control-variable.json +1 -1
  57. package/rules/ruff-b009-get-attr-with-constant.json +1 -1
  58. package/rules/ruff-b010-set-attr-with-constant.json +2 -2
  59. package/rules/ruff-b011-assert-false.json +1 -1
  60. package/rules/ruff-b013-redundant-tuple-in-exception-handler.json +1 -1
  61. package/rules/ruff-b014-duplicate-handler-exception.json +1 -1
  62. package/rules/ruff-b016-raise-literal.json +1 -1
  63. package/rules/ruff-b020-loop-variable-overrides-iterator.json +1 -1
  64. package/rules/ruff-b021-f-string-docstring.json +1 -1
  65. package/rules/ruff-b022-useless-contextlib-suppress.json +1 -1
  66. package/rules/ruff-b023-function-uses-loop-variable.json +2 -2
  67. package/rules/ruff-b025-duplicate-try-block-exception.json +1 -1
  68. package/rules/ruff-b026-star-arg-unpacking-after-keyword-arg.json +1 -1
  69. package/rules/ruff-b028-no-explicit-stacklevel.json +2 -2
  70. package/rules/ruff-b029-except-with-empty-tuple.json +1 -1
  71. package/rules/ruff-b030-except-with-non-exception-classes.json +1 -1
  72. package/rules/ruff-b032-unintentional-type-annotation.json +1 -1
  73. package/rules/ruff-b033-duplicate-value.json +1 -1
  74. package/rules/ruff-b034-re-sub-positional-args.json +1 -1
  75. package/rules/ruff-b039-mutable-contextvar-default.json +2 -2
  76. package/rules/ruff-b904-raise-without-from-inside-except.json +2 -2
  77. package/rules/ruff-b905-zip-without-explicit-strict.json +3 -3
  78. package/rules/ruff-e711-none-comparison.json +190 -6
  79. package/rules/ruff-e721-type-comparison.json +1 -1
  80. package/rules/ruff-e722-bare-except.json +2 -2
  81. package/rules/ruff-e742-ambiguous-class-name.json +2 -2
  82. package/rules/ruff-e743-ambiguous-function-name.json +2 -2
  83. package/rules/ruff-f403-undefined-local-with-import-star.json +1 -1
  84. package/rules/ruff-f405-undefined-local-with-import-star-usage.json +2 -2
  85. package/rules/ruff-f406-undefined-local-with-nested-import-star-usage.json +2 -2
  86. package/rules/ruff-f407-future-feature-not-defined.json +1 -1
  87. package/rules/ruff-f501-percent-format-invalid-format.json +2 -2
  88. package/rules/ruff-f502-percent-format-expected-mapping.json +1 -1
  89. package/rules/ruff-f503-percent-format-expected-sequence.json +1 -1
  90. package/rules/ruff-f504-percent-format-extra-named-arguments.json +1 -1
  91. package/rules/ruff-f505-percent-format-missing-argument.json +1 -1
  92. package/rules/ruff-f506-percent-format-mixed-positional-and-named.json +2 -2
  93. package/rules/ruff-f507-percent-format-positional-count-mismatch.json +2 -2
  94. package/rules/ruff-f508-percent-format-star-requires-sequence.json +2 -2
  95. package/rules/ruff-f509-percent-format-unsupported-format-character.json +2 -2
  96. package/rules/ruff-f521-string-dot-format-invalid-format.json +1 -1
  97. package/rules/ruff-f522-string-dot-format-extra-named-arguments.json +2 -2
  98. package/rules/ruff-f523-string-dot-format-extra-positional-arguments.json +1 -1
  99. package/rules/ruff-f524-string-dot-format-missing-arguments.json +1 -1
  100. package/rules/ruff-f525-string-dot-format-mixing-automatic.json +1 -1
  101. package/rules/ruff-f541-f-string-missing-placeholders.json +3 -3
  102. package/rules/ruff-f601-multi-value-repeated-key-literal.json +1 -1
  103. package/rules/ruff-f602-multi-value-repeated-key-variable.json +2 -2
  104. package/rules/ruff-f622-multiple-starred-expressions.json +1 -1
  105. package/rules/ruff-f632-is-literal.json +222 -5
  106. package/rules/ruff-f633-invalid-print-syntax.json +2 -2
  107. package/rules/ruff-f701-break-outside-loop.json +1 -1
  108. package/rules/ruff-f702-continue-outside-loop.json +1 -1
  109. package/rules/ruff-f706-return-outside-function.json +1 -1
  110. package/rules/ruff-f707-default-except-not-last.json +3 -3
  111. package/rules/ruff-f822-undefined-export.json +1 -1
  112. package/rules/ruff-f823-undefined-local.json +2 -2
  113. package/rules/ruff-f842-unused-annotation.json +1 -1
  114. package/rules/ruff-f901-raise-not-implemented.json +1 -1
  115. package/rules/ruff-pie794-duplicate-class-field-definition.json +1 -1
  116. package/rules/ruff-pie796-non-unique-enums.json +1 -1
  117. package/rules/ruff-pie800-unnecessary-spread.json +1 -1
  118. package/rules/ruff-pie804-unnecessary-dict-kwargs.json +1 -1
  119. package/rules/ruff-pie807-reimplemented-container-builtin.json +1 -1
  120. package/rules/ruff-pie810-multiple-starts-ends-with.json +2 -2
  121. package/rules/ruff-ret501-unnecessary-return-none.json +1 -1
  122. package/rules/ruff-ret502-implicit-return-value.json +2 -2
  123. package/rules/ruff-ret505-superfluous-else-return.json +1 -1
  124. package/rules/ruff-ret506-superfluous-else-raise.json +1 -1
  125. package/rules/ruff-ret507-superfluous-else-continue.json +1 -1
  126. package/rules/ruff-ret508-superfluous-else-break.json +1 -1
  127. package/rules/ruff-sim101-duplicate-isinstance-call.json +1 -1
  128. package/rules/ruff-sim107-return-in-try-except-finally.json +2 -2
  129. package/rules/ruff-sim109-compare-with-tuple.json +1 -1
  130. package/rules/ruff-sim112-uncapitalized-environment-variables.json +3 -3
  131. package/rules/ruff-sim113-enumerate-for-loop.json +1 -1
  132. package/rules/ruff-sim208-double-negation.json +1 -1
  133. package/rules/ruff-sim210-if-expr-with-true-false.json +1 -1
  134. package/rules/ruff-sim211-if-expr-with-false-true.json +1 -1
  135. package/rules/ruff-sim212-if-expr-with-twisted-arms.json +2 -2
  136. package/rules/ruff-sim300-yoda-conditions.json +3 -3
  137. package/rules/ruff-sim905-split-static-string.json +1 -1
  138. package/rules/ruff-sim910-dict-get-with-none-default.json +1 -1
  139. package/rules/ruff-t100-debugger.json +3 -3
@@ -3,7 +3,7 @@
3
3
  "id": "ruff-sim208-double-negation",
4
4
  "revision": 1,
5
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).",
6
+ "description": "Remove double negation with not not; use the value itself, or bool() if you need a real boolean.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*"
@@ -3,7 +3,7 @@
3
3
  "id": "ruff-sim210-if-expr-with-true-false",
4
4
  "revision": 1,
5
5
  "mode": "steer",
6
- "description": "Port of Ruff's SIM210 (if-expr-with-true-false): a conditional expression whose body is the literal `True` and whose `else` arm is `False` (through any parentheses), reported on the whole expression. Ruff's message and fix differ when the test is a comparison or `bool` is shadowed; what is flagged does not.",
6
+ "description": "Use bool() on the condition instead of a conditional expression that yields True when it holds and False otherwise.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*"
@@ -3,7 +3,7 @@
3
3
  "id": "ruff-sim211-if-expr-with-false-true",
4
4
  "revision": 1,
5
5
  "mode": "steer",
6
- "description": "Port of Ruff's SIM211 (if-expr-with-false-true): a conditional expression whose body is the literal `False` and whose `else` arm is `True` (through any parentheses), reported on the whole expression.",
6
+ "description": "Use not on the condition instead of a conditional expression that yields False when it holds and True otherwise.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*"
@@ -3,7 +3,7 @@
3
3
  "id": "ruff-sim212-if-expr-with-twisted-arms",
4
4
  "revision": 1,
5
5
  "mode": "steer",
6
- "description": "Port of Ruff's SIM212 (if-expr-with-twisted-arms): `B if not A else A` where the negated test operand and the `else` arm are the same plain name (through any parentheses), reported on the whole expression.",
6
+ "description": "Swap the arms of a conditional expression that tests not x and falls back to x, so the test reads x without the negation.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*"
@@ -81,7 +81,7 @@
81
81
  "violation": {
82
82
  "anchor": "witness.span",
83
83
  "code": "SIM212",
84
- "message": "Use `$A if $A else ...` instead of `... if not $A else $A`",
84
+ "message": "Swap the arms to read `$A if $A else ...`, dropping the `not` from `... if not $A else $A`.",
85
85
  "suppress": {
86
86
  "noqa": {
87
87
  "codes": [
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "format": "rerail.policy/v1",
3
3
  "id": "ruff-sim300-yoda-conditions",
4
- "revision": 1,
4
+ "revision": 2,
5
5
  "mode": "steer",
6
- "description": "Port of Ruff's SIM300 (yoda-conditions): a comparison with one `==`, `!=`, `<`, `<=`, `>` or `>=` whose left operand is more constant-like than its right, on Ruff's three levels (`ConstantLikelihood`, flake8_simplify/rules/yoda_conditions.rs:76-136): literals (not f- or t-strings) are definite; a name or attribute whose name is cased uppercase is probable; tuples, lists and dicts (keys and values, `**` values), binary operations and unary `+`/`-`/`~` take the least of their parts (empty is definite); everything else, sets included, is unlikely. Reported on the comparison.",
6
+ "description": "Put the variable first and the constant or literal second in comparisons, avoiding Yoda conditions; it reads the way you would say it.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*"
@@ -473,7 +473,7 @@
473
473
  "violation": {
474
474
  "anchor": "witness.span",
475
475
  "code": "SIM300",
476
- "message": "Yoda condition detected",
476
+ "message": "Put the variable first; reverse `<`/`>` and `<=`/`>=` when swapping operands, and keep equality operators unchanged.",
477
477
  "suppress": {
478
478
  "noqa": {
479
479
  "codes": [
@@ -3,7 +3,7 @@
3
3
  "id": "ruff-sim905-split-static-string",
4
4
  "revision": 1,
5
5
  "mode": "steer",
6
- "description": "Port of Ruff's SIM905 (split-static-string): `.split(...)` or `.rsplit(...)` called on a str literal (implicit concatenations included; not bytes, f- or t-strings), where `sep` (keyword, else first positional argument) is absent, `None` or a str literal, and `maxsplit` (keyword, else second positional argument) is absent or an integer literal, optionally negated, that fits in an i32 (`get_maxsplit_value`). Reported on the call.",
6
+ "description": "Use a list literal instead of calling split() or rsplit() on a string literal; the result is known in advance.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*"
@@ -3,7 +3,7 @@
3
3
  "id": "ruff-sim910-dict-get-with-none-default",
4
4
  "revision": 1,
5
5
  "mode": "steer",
6
- "description": "Port of Ruff's SIM910 (dict-get-with-none-default): `.get(key, None, ...)` whose second positional argument is `None`, with no keywords, called on a dict display or dict comprehension (through parentheses), or on a name whose binding is a dict (Ruff's `is_dict` through `resolves.binding`: a `def`'s `**kwargs`, a dict-typed value or `dict(...)`, a `dict`/`Dict` annotation or return annotation; unpacking carries no value).",
6
+ "description": "Drop the redundant None default from dict.get() calls; get() already returns None for a missing key.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*"
@@ -3,7 +3,7 @@
3
3
  "id": "ruff-t100-debugger",
4
4
  "revision": 1,
5
5
  "mode": "steer",
6
- "description": "Port of Ruff's T100 (debugger): imports of debugger modules (`is_debugger_import`) and of debugger functions (`from M import n` with `M.n` in `is_debugger_call`), once per imported name, matched by module with `resolves.imported`, relative imports by the module's text (`relative: \"text\"`: Ruff ignores the level). It also flags calls whose callee resolves to a debugger function (`resolve_qualified_name` through the file's imports, or the builtin `breakpoint`).",
6
+ "description": "Remove debugger imports and calls such as pdb.set_trace() and breakpoint() before committing.",
7
7
  "scope": {
8
8
  "include": [
9
9
  "**/*"
@@ -106,7 +106,7 @@
106
106
  "violation": {
107
107
  "anchor": "witness.span",
108
108
  "code": "T100",
109
- "message": "Import for a debugger found",
109
+ "message": "Remove this debugger import of `$D` before committing.",
110
110
  "each": "D",
111
111
  "suppress": {
112
112
  "noqa": {
@@ -183,7 +183,7 @@
183
183
  "violation": {
184
184
  "anchor": "witness.span",
185
185
  "code": "T100",
186
- "message": "Trace found: debugger used",
186
+ "message": "Remove this debugger call before committing.",
187
187
  "suppress": {
188
188
  "noqa": {
189
189
  "codes": [