@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.
- package/README.md +707 -3
- package/licenses/bandit/UPSTREAM.md +10 -0
- package/licenses/ruff/UPSTREAM.md +56 -0
- package/pack.json +7 -20
- package/package.json +1 -1
- package/rules/bandit-b101-assert-used.json +2 -2
- package/rules/bandit-b102-exec-used.json +2 -2
- package/rules/bandit-b110-try-except-pass.json +1 -1
- package/rules/bandit-b112-try-except-continue.json +1 -1
- package/rules/bandit-b113-request-without-timeout.json +2 -2
- package/rules/bandit-b301-pickle.json +2 -2
- package/rules/bandit-b302-marshal.json +2 -2
- package/rules/bandit-b303-md5.json +1 -1
- package/rules/bandit-b305-cipher-modes.json +2 -2
- package/rules/bandit-b306-mktemp-q.json +2 -2
- package/rules/bandit-b307-eval.json +1 -1
- package/rules/bandit-b308-mark-safe.json +2 -2
- package/rules/bandit-b310-urllib-urlopen.json +1 -1
- package/rules/bandit-b311-random.json +1 -1
- package/rules/bandit-b312-telnetlib.json +1 -1
- package/rules/bandit-b313-xml-bad-celementtree.json +1 -1
- package/rules/bandit-b314-xml-bad-elementtree.json +1 -1
- package/rules/bandit-b315-xml-bad-expatreader.json +1 -1
- package/rules/bandit-b316-xml-bad-expatbuilder.json +1 -1
- package/rules/bandit-b317-xml-bad-sax.json +1 -1
- package/rules/bandit-b318-xml-bad-minidom.json +1 -1
- package/rules/bandit-b319-xml-bad-pulldom.json +1 -1
- package/rules/bandit-b321-ftplib.json +2 -2
- package/rules/bandit-b323-unverified-context.json +2 -2
- package/rules/bandit-b401-import-telnetlib.json +2 -2
- package/rules/bandit-b402-import-ftplib.json +2 -2
- package/rules/bandit-b405-import-xml-etree.json +1 -1
- package/rules/bandit-b407-import-xml-expat.json +1 -1
- package/rules/bandit-b408-import-xml-minidom.json +1 -1
- package/rules/bandit-b409-import-xml-pulldom.json +1 -1
- package/rules/bandit-b411-import-xmlrpclib.json +1 -1
- package/rules/bandit-b413-import-pycrypto.json +1 -1
- package/rules/bandit-b415-import-pyghmi.json +2 -2
- package/rules/bandit-b502-ssl-with-bad-version.json +2 -2
- package/rules/bandit-b505-weak-cryptographic-key.json +2 -2
- package/rules/bandit-b507-ssh-no-host-key-verification.json +2 -2
- package/rules/bandit-b606-start-process-with-no-shell.json +2 -2
- package/rules/bandit-b615-huggingface-unsafe-download.json +2 -2
- package/rules/ruff-async100-cancel-scope-no-checkpoint.json +2 -2
- package/rules/ruff-async105-trio-sync-call.json +1 -1
- package/rules/ruff-async115-async-zero-sleep.json +1 -1
- package/rules/ruff-async116-long-sleep-not-forever.json +1 -1
- package/rules/ruff-async210-blocking-http-call-in-async-function.json +2 -2
- package/rules/ruff-async221-run-process-in-async-function.json +1 -1
- package/rules/ruff-async222-wait-for-process-in-async-function.json +2 -2
- package/rules/ruff-async230-blocking-open-call-in-async-function.json +2 -2
- package/rules/ruff-async250-blocking-input-in-async-function.json +2 -2
- package/rules/ruff-async251-blocking-sleep-in-async-function.json +1 -1
- package/rules/ruff-b002-unary-prefix-increment-decrement.json +3 -3
- package/rules/ruff-b003-assignment-to-os-environ.json +2 -2
- package/rules/ruff-b004-unreliable-callable-check.json +1 -1
- package/rules/ruff-b005-strip-with-multi-characters.json +2 -2
- package/rules/ruff-b007-unused-loop-control-variable.json +1 -1
- package/rules/ruff-b009-get-attr-with-constant.json +1 -1
- package/rules/ruff-b010-set-attr-with-constant.json +2 -2
- package/rules/ruff-b011-assert-false.json +1 -1
- package/rules/ruff-b013-redundant-tuple-in-exception-handler.json +1 -1
- package/rules/ruff-b014-duplicate-handler-exception.json +1 -1
- package/rules/ruff-b016-raise-literal.json +1 -1
- package/rules/ruff-b020-loop-variable-overrides-iterator.json +1 -1
- package/rules/ruff-b021-f-string-docstring.json +1 -1
- package/rules/ruff-b022-useless-contextlib-suppress.json +1 -1
- package/rules/ruff-b023-function-uses-loop-variable.json +2 -2
- package/rules/ruff-b025-duplicate-try-block-exception.json +1 -1
- package/rules/ruff-b026-star-arg-unpacking-after-keyword-arg.json +1 -1
- package/rules/ruff-b028-no-explicit-stacklevel.json +2 -2
- package/rules/ruff-b029-except-with-empty-tuple.json +1 -1
- package/rules/ruff-b030-except-with-non-exception-classes.json +406 -0
- package/rules/ruff-b032-unintentional-type-annotation.json +1 -1
- package/rules/ruff-b033-duplicate-value.json +1 -1
- package/rules/ruff-b034-re-sub-positional-args.json +1 -1
- package/rules/ruff-b039-mutable-contextvar-default.json +2 -2
- package/rules/ruff-b904-raise-without-from-inside-except.json +2 -2
- package/rules/ruff-b905-zip-without-explicit-strict.json +1 -1
- package/rules/ruff-e711-none-comparison.json +1 -1
- package/rules/ruff-e721-type-comparison.json +1 -1
- package/rules/ruff-e722-bare-except.json +2 -2
- package/rules/ruff-e742-ambiguous-class-name.json +2 -2
- package/rules/ruff-e743-ambiguous-function-name.json +2 -2
- package/rules/ruff-f403-undefined-local-with-import-star.json +1 -1
- package/rules/ruff-f405-undefined-local-with-import-star-usage.json +2 -2
- package/rules/ruff-f406-undefined-local-with-nested-import-star-usage.json +2 -2
- package/rules/ruff-f407-future-feature-not-defined.json +1 -1
- package/rules/ruff-f501-percent-format-invalid-format.json +2 -2
- package/rules/ruff-f502-percent-format-expected-mapping.json +1 -1
- package/rules/ruff-f503-percent-format-expected-sequence.json +1 -1
- package/rules/ruff-f504-percent-format-extra-named-arguments.json +1 -1
- package/rules/ruff-f505-percent-format-missing-argument.json +1 -1
- package/rules/ruff-f506-percent-format-mixed-positional-and-named.json +2 -2
- package/rules/ruff-f507-percent-format-positional-count-mismatch.json +2 -2
- package/rules/ruff-f508-percent-format-star-requires-sequence.json +2 -2
- package/rules/ruff-f509-percent-format-unsupported-format-character.json +2 -2
- package/rules/ruff-f521-string-dot-format-invalid-format.json +1 -1
- package/rules/ruff-f522-string-dot-format-extra-named-arguments.json +2 -2
- package/rules/ruff-f523-string-dot-format-extra-positional-arguments.json +1 -1
- package/rules/ruff-f524-string-dot-format-missing-arguments.json +1 -1
- package/rules/ruff-f525-string-dot-format-mixing-automatic.json +1 -1
- package/rules/ruff-f541-f-string-missing-placeholders.json +2 -2
- package/rules/ruff-f601-multi-value-repeated-key-literal.json +1 -1
- package/rules/ruff-f602-multi-value-repeated-key-variable.json +2 -2
- package/rules/ruff-f622-multiple-starred-expressions.json +1 -1
- package/rules/ruff-f632-is-literal.json +1 -1
- package/rules/ruff-f633-invalid-print-syntax.json +2 -2
- package/rules/ruff-f701-break-outside-loop.json +1 -1
- package/rules/ruff-f702-continue-outside-loop.json +1 -1
- package/rules/ruff-f706-return-outside-function.json +1 -1
- package/rules/ruff-f707-default-except-not-last.json +1 -1
- package/rules/ruff-f822-undefined-export.json +1 -1
- package/rules/ruff-f823-undefined-local.json +2 -2
- package/rules/ruff-f842-unused-annotation.json +1 -1
- package/rules/ruff-f901-raise-not-implemented.json +1 -1
- package/rules/ruff-pie794-duplicate-class-field-definition.json +1 -1
- package/rules/ruff-pie796-non-unique-enums.json +1 -1
- package/rules/ruff-pie800-unnecessary-spread.json +1 -1
- package/rules/ruff-pie804-unnecessary-dict-kwargs.json +1 -1
- package/rules/ruff-pie807-reimplemented-container-builtin.json +1 -1
- package/rules/ruff-pie810-multiple-starts-ends-with.json +2 -2
- package/rules/ruff-ret501-unnecessary-return-none.json +1 -1
- package/rules/ruff-ret502-implicit-return-value.json +2 -2
- package/rules/ruff-ret505-superfluous-else-return.json +1 -1
- package/rules/ruff-ret506-superfluous-else-raise.json +1 -1
- package/rules/ruff-ret507-superfluous-else-continue.json +1 -1
- package/rules/ruff-ret508-superfluous-else-break.json +1 -1
- package/rules/ruff-sim101-duplicate-isinstance-call.json +1 -1
- package/rules/ruff-sim107-return-in-try-except-finally.json +2 -2
- package/rules/ruff-sim109-compare-with-tuple.json +1 -1
- package/rules/ruff-sim112-uncapitalized-environment-variables.json +2 -2
- package/rules/ruff-sim113-enumerate-for-loop.json +1 -1
- package/rules/ruff-sim208-double-negation.json +1 -1
- package/rules/ruff-sim210-if-expr-with-true-false.json +1 -1
- package/rules/ruff-sim211-if-expr-with-false-true.json +1 -1
- package/rules/ruff-sim212-if-expr-with-twisted-arms.json +2 -2
- package/rules/ruff-sim300-yoda-conditions.json +2 -2
- package/rules/ruff-sim905-split-static-string.json +1 -1
- package/rules/ruff-sim910-dict-get-with-none-default.json +1 -1
- package/rules/ruff-t100-debugger.json +3 -3
- package/rules/bandit-b406-import-xml-sax.json +0 -73
- package/rules/bandit-b610-django-extra-used.json +0 -268
- package/rules/ruff-f722-forward-annotation-syntax-error.json +0 -654
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b016-raise-literal",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Raise an exception instance instead of a literal like a string or number; raising a literal fails with a TypeError.",
|
|
7
7
|
"scope": { "include": ["**/*"], "exclude": [] },
|
|
8
8
|
"clauses": [
|
|
9
9
|
{
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b020-loop-variable-overrides-iterator",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Don't name a for-loop variable after a name used in the loop's iterable; the loop overwrites the original value.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b021-f-string-docstring",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use a plain string literal, not an f-string, for docstrings; Python doesn't treat an f-string as a docstring.",
|
|
7
7
|
"scope": { "include": ["**/*"], "exclude": [] },
|
|
8
8
|
"clauses": [
|
|
9
9
|
{
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b022-useless-contextlib-suppress",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Pass at least one exception type to contextlib.suppress(); with none it suppresses nothing.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b023-function-uses-loop-variable",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Pass loop variables into functions and lambdas defined inside a loop as arguments or defaults; otherwise they all see the variable's last value.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -546,7 +546,7 @@
|
|
|
546
546
|
"violation": {
|
|
547
547
|
"anchor": "witness.span",
|
|
548
548
|
"code": "B023",
|
|
549
|
-
"message": "
|
|
549
|
+
"message": "Bind `$N` as a default argument, such as `$N=$N`, so the function keeps this iteration's value.",
|
|
550
550
|
"suppress": {
|
|
551
551
|
"noqa": {
|
|
552
552
|
"codes": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b025-duplicate-try-block-exception",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove exception types repeated across handlers of the same try block; only the first handler that names one can ever run.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b026-star-arg-unpacking-after-keyword-arg",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Put star-argument unpacking before keyword arguments in calls; placing it after is legal but misleading about argument order.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b028-no-explicit-stacklevel",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Pass an explicit stacklevel to warnings.warn(); without it the warning points at the warn call instead of the caller who triggered it.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"violation": {
|
|
164
164
|
"anchor": "witness.span",
|
|
165
165
|
"code": "B028",
|
|
166
|
-
"message": "
|
|
166
|
+
"message": "Pass stacklevel= to this warnings.warn() call, usually 2, so the warning points at the caller.",
|
|
167
167
|
"suppress": {
|
|
168
168
|
"noqa": {
|
|
169
169
|
"codes": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b029-except-with-empty-tuple",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Don't write an except clause with an empty tuple as its type; it catches nothing, so name the exceptions to handle.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "rerail.policy/v1",
|
|
3
|
+
"id": "ruff-b030-except-with-non-exception-classes",
|
|
4
|
+
"revision": 2,
|
|
5
|
+
"mode": "steer",
|
|
6
|
+
"description": "Use only exception classes, or tuples of them, in except clauses; other values such as literals or expressions are not valid exception types.",
|
|
7
|
+
"scope": {
|
|
8
|
+
"include": [
|
|
9
|
+
"**/*"
|
|
10
|
+
],
|
|
11
|
+
"exclude": []
|
|
12
|
+
},
|
|
13
|
+
"clauses": [
|
|
14
|
+
{
|
|
15
|
+
"id": "except-with-non-exception-classes",
|
|
16
|
+
"forbid": {
|
|
17
|
+
"ast": {
|
|
18
|
+
"language": "python",
|
|
19
|
+
"utils": {
|
|
20
|
+
"type-slot": {
|
|
21
|
+
"any": [
|
|
22
|
+
{
|
|
23
|
+
"follows": {
|
|
24
|
+
"stopBy": "neighbor",
|
|
25
|
+
"regex": "^(except|\\*)$"
|
|
26
|
+
},
|
|
27
|
+
"not": {
|
|
28
|
+
"precedes": {
|
|
29
|
+
"stopBy": "neighbor",
|
|
30
|
+
"regex": "^,$"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"inside": {
|
|
34
|
+
"stopBy": "neighbor",
|
|
35
|
+
"kind": "except_clause"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"not": {
|
|
40
|
+
"follows": {
|
|
41
|
+
"stopBy": "neighbor",
|
|
42
|
+
"regex": "(?s)."
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"inside": {
|
|
46
|
+
"stopBy": "neighbor",
|
|
47
|
+
"kind": "as_pattern",
|
|
48
|
+
"matches": "type-slot"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"inside": {
|
|
53
|
+
"stopBy": "neighbor",
|
|
54
|
+
"kind": "parenthesized_expression",
|
|
55
|
+
"matches": "type-slot"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"plus": {
|
|
61
|
+
"kind": "binary_operator",
|
|
62
|
+
"has": {
|
|
63
|
+
"stopBy": "neighbor",
|
|
64
|
+
"regex": "^\\+$"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"core": {
|
|
68
|
+
"not": {
|
|
69
|
+
"any": [
|
|
70
|
+
{
|
|
71
|
+
"kind": "parenthesized_expression"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"kind": "comment"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"regex": "^[(),*+:\\[\\]]$"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"kind": "as_pattern"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"comma-elem": {
|
|
86
|
+
"any": [
|
|
87
|
+
{
|
|
88
|
+
"inside": {
|
|
89
|
+
"stopBy": "neighbor",
|
|
90
|
+
"kind": "except_clause"
|
|
91
|
+
},
|
|
92
|
+
"any": [
|
|
93
|
+
{
|
|
94
|
+
"precedes": {
|
|
95
|
+
"stopBy": "neighbor",
|
|
96
|
+
"regex": "^,$"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"follows": {
|
|
101
|
+
"stopBy": "neighbor",
|
|
102
|
+
"regex": "^,$"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"inside": {
|
|
109
|
+
"stopBy": "neighbor",
|
|
110
|
+
"kind": "parenthesized_expression",
|
|
111
|
+
"matches": "comma-elem"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"queued-splat": {
|
|
117
|
+
"kind": "list_splat",
|
|
118
|
+
"matches": "queued"
|
|
119
|
+
},
|
|
120
|
+
"queued-plus": {
|
|
121
|
+
"matches": "plus",
|
|
122
|
+
"all": [
|
|
123
|
+
{
|
|
124
|
+
"matches": "queued"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"elem-of-type-tuple": {
|
|
129
|
+
"any": [
|
|
130
|
+
{
|
|
131
|
+
"inside": {
|
|
132
|
+
"stopBy": "neighbor",
|
|
133
|
+
"kind": "tuple",
|
|
134
|
+
"matches": "type-slot"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"inside": {
|
|
139
|
+
"stopBy": "neighbor",
|
|
140
|
+
"kind": "parenthesized_expression",
|
|
141
|
+
"matches": "elem-of-type-tuple"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
"elem-of-splat-seq": {
|
|
147
|
+
"any": [
|
|
148
|
+
{
|
|
149
|
+
"inside": {
|
|
150
|
+
"stopBy": "neighbor",
|
|
151
|
+
"any": [
|
|
152
|
+
{
|
|
153
|
+
"kind": "tuple"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"kind": "list"
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"inside": {
|
|
160
|
+
"stopBy": "neighbor",
|
|
161
|
+
"matches": "queued-splat"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"inside": {
|
|
167
|
+
"stopBy": "neighbor",
|
|
168
|
+
"kind": "parenthesized_expression",
|
|
169
|
+
"matches": "elem-of-splat-seq"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"value-of-queued-splat": {
|
|
175
|
+
"any": [
|
|
176
|
+
{
|
|
177
|
+
"inside": {
|
|
178
|
+
"stopBy": "neighbor",
|
|
179
|
+
"matches": "queued-splat"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"inside": {
|
|
184
|
+
"stopBy": "neighbor",
|
|
185
|
+
"kind": "parenthesized_expression",
|
|
186
|
+
"matches": "value-of-queued-splat"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
"side-of-queued-plus": {
|
|
192
|
+
"any": [
|
|
193
|
+
{
|
|
194
|
+
"inside": {
|
|
195
|
+
"stopBy": "neighbor",
|
|
196
|
+
"matches": "queued-plus"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"inside": {
|
|
201
|
+
"stopBy": "neighbor",
|
|
202
|
+
"kind": "parenthesized_expression",
|
|
203
|
+
"matches": "side-of-queued-plus"
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
"elem-of-side-tuple": {
|
|
209
|
+
"any": [
|
|
210
|
+
{
|
|
211
|
+
"inside": {
|
|
212
|
+
"stopBy": "neighbor",
|
|
213
|
+
"kind": "tuple",
|
|
214
|
+
"matches": "side-of-queued-plus"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"inside": {
|
|
219
|
+
"stopBy": "neighbor",
|
|
220
|
+
"kind": "parenthesized_expression",
|
|
221
|
+
"matches": "elem-of-side-tuple"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
"value-of-side-splat": {
|
|
227
|
+
"any": [
|
|
228
|
+
{
|
|
229
|
+
"inside": {
|
|
230
|
+
"stopBy": "neighbor",
|
|
231
|
+
"kind": "list_splat",
|
|
232
|
+
"matches": "side-of-queued-plus"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"inside": {
|
|
237
|
+
"stopBy": "neighbor",
|
|
238
|
+
"kind": "parenthesized_expression",
|
|
239
|
+
"matches": "value-of-side-splat"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"queued": {
|
|
245
|
+
"matches": "core",
|
|
246
|
+
"any": [
|
|
247
|
+
{
|
|
248
|
+
"matches": "type-slot",
|
|
249
|
+
"not": {
|
|
250
|
+
"kind": "tuple"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"matches": "elem-of-type-tuple"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"matches": "comma-elem"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"matches": "elem-of-splat-seq"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"matches": "plus",
|
|
264
|
+
"all": [
|
|
265
|
+
{
|
|
266
|
+
"matches": "value-of-queued-splat"
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"matches": "plus",
|
|
272
|
+
"all": [
|
|
273
|
+
{
|
|
274
|
+
"matches": "side-of-queued-plus"
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"matches": "elem-of-side-tuple"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"matches": "plus",
|
|
283
|
+
"all": [
|
|
284
|
+
{
|
|
285
|
+
"matches": "value-of-side-splat"
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
"flat": {
|
|
292
|
+
"matches": "core",
|
|
293
|
+
"any": [
|
|
294
|
+
{
|
|
295
|
+
"matches": "queued",
|
|
296
|
+
"not": {
|
|
297
|
+
"any": [
|
|
298
|
+
{
|
|
299
|
+
"kind": "list_splat"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"matches": "plus"
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"all": [
|
|
309
|
+
{
|
|
310
|
+
"matches": "value-of-queued-splat"
|
|
311
|
+
}
|
|
312
|
+
],
|
|
313
|
+
"not": {
|
|
314
|
+
"any": [
|
|
315
|
+
{
|
|
316
|
+
"kind": "tuple"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"kind": "list"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"matches": "plus"
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"all": [
|
|
329
|
+
{
|
|
330
|
+
"matches": "side-of-queued-plus"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"not": {
|
|
334
|
+
"any": [
|
|
335
|
+
{
|
|
336
|
+
"kind": "tuple"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"kind": "list_splat"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"matches": "plus"
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"all": [
|
|
349
|
+
{
|
|
350
|
+
"matches": "value-of-side-splat"
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
"not": {
|
|
354
|
+
"any": [
|
|
355
|
+
{
|
|
356
|
+
"kind": "list_splat"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"matches": "plus"
|
|
360
|
+
}
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"rule": {
|
|
368
|
+
"matches": "flat",
|
|
369
|
+
"not": {
|
|
370
|
+
"any": [
|
|
371
|
+
{
|
|
372
|
+
"kind": "identifier"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"kind": "attribute"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"kind": "subscript"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"kind": "call"
|
|
382
|
+
}
|
|
383
|
+
]
|
|
384
|
+
},
|
|
385
|
+
"inside": {
|
|
386
|
+
"stopBy": "end",
|
|
387
|
+
"kind": "except_clause"
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
"violation": {
|
|
393
|
+
"anchor": "witness.span",
|
|
394
|
+
"code": "B030",
|
|
395
|
+
"message": "`except` handlers should only be exception classes or tuples of exception classes",
|
|
396
|
+
"suppress": {
|
|
397
|
+
"noqa": {
|
|
398
|
+
"codes": [
|
|
399
|
+
"B030"
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
]
|
|
406
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b032-unintentional-type-annotation",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use = instead of : when setting a subscript or another object's attribute without a value; a colon there makes a type annotation that assigns nothing.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b033-duplicate-value",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Remove duplicate literal values from Python set literals; the repeat is dropped silently and usually hides a typo, and values like True, 1 and 1.0 count as the same.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b034-re-sub-positional-args",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Pass count, maxsplit and flags as keyword arguments to re.sub(), re.subn() and re.split(); their positional order is easy to get wrong.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b039-mutable-contextvar-default",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Don't give a ContextVar a mutable default such as a list, dict or set; the one default object is shared across every context.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
"violation": {
|
|
268
268
|
"anchor": "witness.span",
|
|
269
269
|
"code": "B039",
|
|
270
|
-
"message": "
|
|
270
|
+
"message": "Default this ContextVar to None and set the mutable value with .set(); a mutable default is shared by every context.",
|
|
271
271
|
"suppress": {
|
|
272
272
|
"noqa": {
|
|
273
273
|
"codes": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b904-raise-without-from-inside-except",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use raise ... from err (or from None) when raising a new exception inside an except block; it keeps the cause chain clear instead of looking like a bug in the handler.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*.py",
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"violation": {
|
|
181
181
|
"anchor": "witness.span",
|
|
182
182
|
"code": "B904",
|
|
183
|
-
"message": "
|
|
183
|
+
"message": "Raise this exception with `from err` or `from None` so the cause chain is clear.",
|
|
184
184
|
"suppress": {
|
|
185
185
|
"noqa": {
|
|
186
186
|
"codes": [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-b905-zip-without-explicit-strict",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Pass strict= explicitly to zip() over two or more iterables on Python 3.10+; otherwise mismatched lengths are truncated silently.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-e711-none-comparison",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use is None or is not None instead of == or != to compare with None; equality can be overridden and gives surprising results.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-e721-type-comparison",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Use isinstance(), or is and is not, instead of == or != to compare types; equality on types misses subclasses and can be overridden.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "ruff-e722-bare-except",
|
|
4
4
|
"revision": 1,
|
|
5
5
|
"mode": "steer",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Name the exception types in except clauses instead of a bare except, unless the handler re-raises; a bare except also catches KeyboardInterrupt and SystemExit.",
|
|
7
7
|
"scope": {
|
|
8
8
|
"include": [
|
|
9
9
|
"**/*"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"violation": {
|
|
44
44
|
"anchor": "witness.span",
|
|
45
45
|
"code": "E722",
|
|
46
|
-
"message": "
|
|
46
|
+
"message": "Name the exception types this bare except should catch; it also catches KeyboardInterrupt and SystemExit.",
|
|
47
47
|
"suppress": {
|
|
48
48
|
"noqa": {
|
|
49
49
|
"codes": [
|