@neralabs/rerail-pack-python 0.1.2 → 0.1.3
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 +3 -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/ruff-b030-except-with-non-exception-classes.json +406 -0
- 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
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"format": "rerail.policy/v1",
|
|
3
|
-
"id": "bandit-b610-django-extra-used",
|
|
4
|
-
"revision": 2,
|
|
5
|
-
"mode": "steer",
|
|
6
|
-
"description": "Port of Bandit 1.9.4's B610 django_extra_used: a call of `extra` whose `where` or `tables` is not a list of plain strings, or whose `select` is not a dict of plain strings, bound to QuerySet.extra's six positional slots. Port of the kernel test b610_extra_with_a_non_literal_where_tables_or_select. Bandit's `# nosec` is honoured (`suppress.nosec`), as its recordings honour it. Divergence: Bandit reports a call of any function or method named `extra`; the port reports only a method call whose receiver looks like a Django QuerySet or Manager: a name or attribute named `objects`, `qs`, `QS`, `queryset`, `querysets`, `manager` or `managers`, alone or after an underscore-joined prefix (`User.objects`, `self.queryset`, `base_qs`, `_default_manager`); a call of `get_queryset`; a method call on such a receiver (`User.objects.filter(...)`); or `self` or `super()` inside a class with a base whose name ends in `QuerySet` (`QuerySet`, `SoftDeleteQuerySet`, `TreeQuerySet`) or is `Manager`, `BaseManager` or `BaseUserManager`, optionally dotted (`models.QuerySet`); a base that only ends in `Manager` (`AbstractContextManager`, `PluginManager`, `TreeManager`) does not count. A bare `extra(...)` call and `extra` on any other receiver (`parser.extra(...)`, `self.extra(...)` in an unrelated class) are not reported (NER-1827).",
|
|
7
|
-
"scope": {
|
|
8
|
-
"include": [
|
|
9
|
-
"**/*"
|
|
10
|
-
],
|
|
11
|
-
"exclude": []
|
|
12
|
-
},
|
|
13
|
-
"clauses": [
|
|
14
|
-
{
|
|
15
|
-
"id": "django-extra-used",
|
|
16
|
-
"forbid": {
|
|
17
|
-
"ast": {
|
|
18
|
-
"language": "python",
|
|
19
|
-
"rule": {
|
|
20
|
-
"any": [
|
|
21
|
-
{
|
|
22
|
-
"pattern": "$R.extra($$$)"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"all": [
|
|
26
|
-
{
|
|
27
|
-
"has": {
|
|
28
|
-
"field": "function",
|
|
29
|
-
"has": {
|
|
30
|
-
"field": "object",
|
|
31
|
-
"matches": "queryset-receiver"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"any": [
|
|
37
|
-
{
|
|
38
|
-
"arguments": {
|
|
39
|
-
"signature": [
|
|
40
|
-
"select",
|
|
41
|
-
"where",
|
|
42
|
-
"params",
|
|
43
|
-
"tables",
|
|
44
|
-
"order_by",
|
|
45
|
-
"select_params"
|
|
46
|
-
],
|
|
47
|
-
"bind": {
|
|
48
|
-
"W": "where"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"has": {
|
|
52
|
-
"stopBy": "end",
|
|
53
|
-
"pattern": "$W",
|
|
54
|
-
"not": {
|
|
55
|
-
"matches": "strings"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"arguments": {
|
|
61
|
-
"signature": [
|
|
62
|
-
"select",
|
|
63
|
-
"where",
|
|
64
|
-
"params",
|
|
65
|
-
"tables",
|
|
66
|
-
"order_by",
|
|
67
|
-
"select_params"
|
|
68
|
-
],
|
|
69
|
-
"bind": {
|
|
70
|
-
"T": "tables"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"has": {
|
|
74
|
-
"stopBy": "end",
|
|
75
|
-
"pattern": "$T",
|
|
76
|
-
"not": {
|
|
77
|
-
"matches": "strings"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"arguments": {
|
|
83
|
-
"signature": [
|
|
84
|
-
"select",
|
|
85
|
-
"where",
|
|
86
|
-
"params",
|
|
87
|
-
"tables",
|
|
88
|
-
"order_by",
|
|
89
|
-
"select_params"
|
|
90
|
-
],
|
|
91
|
-
"bind": {
|
|
92
|
-
"S": "select"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"has": {
|
|
96
|
-
"stopBy": "end",
|
|
97
|
-
"pattern": "$S",
|
|
98
|
-
"not": {
|
|
99
|
-
"matches": "string-pairs"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
"utils": {
|
|
108
|
-
"queryset-receiver": {
|
|
109
|
-
"any": [
|
|
110
|
-
{
|
|
111
|
-
"kind": "identifier",
|
|
112
|
-
"regex": "^(?:[A-Za-z0-9_]*_)?(?:qs|QS|querysets?|objects|managers?)$"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"kind": "attribute",
|
|
116
|
-
"has": {
|
|
117
|
-
"field": "attribute",
|
|
118
|
-
"regex": "^(?:[A-Za-z0-9_]*_)?(?:qs|QS|querysets?|objects|managers?)$"
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"kind": "call",
|
|
123
|
-
"has": {
|
|
124
|
-
"field": "function",
|
|
125
|
-
"kind": "attribute",
|
|
126
|
-
"has": {
|
|
127
|
-
"field": "object",
|
|
128
|
-
"matches": "queryset-receiver"
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"kind": "call",
|
|
134
|
-
"has": {
|
|
135
|
-
"field": "function",
|
|
136
|
-
"any": [
|
|
137
|
-
{
|
|
138
|
-
"kind": "identifier",
|
|
139
|
-
"regex": "^get_queryset$"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"kind": "attribute",
|
|
143
|
-
"has": {
|
|
144
|
-
"field": "attribute",
|
|
145
|
-
"regex": "^get_queryset$"
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
]
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"any": [
|
|
153
|
-
{
|
|
154
|
-
"kind": "identifier",
|
|
155
|
-
"regex": "^self$"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"pattern": "super()"
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
"inside": {
|
|
162
|
-
"stopBy": "end",
|
|
163
|
-
"kind": "class_definition",
|
|
164
|
-
"has": {
|
|
165
|
-
"field": "superclasses",
|
|
166
|
-
"regex": "(?:^|[(,\\s])(?:[A-Za-z_][A-Za-z0-9_]*\\.)*(?:[A-Za-z0-9_]*QuerySet|Manager|BaseManager|BaseUserManager)\\b"
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
},
|
|
172
|
-
"string": {
|
|
173
|
-
"any": [
|
|
174
|
-
{
|
|
175
|
-
"kind": "string",
|
|
176
|
-
"not": {
|
|
177
|
-
"regex": "^[A-Za-z]*[fFbBtT]"
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"kind": "concatenated_string",
|
|
182
|
-
"not": {
|
|
183
|
-
"has": {
|
|
184
|
-
"kind": "string",
|
|
185
|
-
"regex": "^[A-Za-z]*[fFbBtT]"
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
]
|
|
190
|
-
},
|
|
191
|
-
"strings": {
|
|
192
|
-
"kind": "list",
|
|
193
|
-
"not": {
|
|
194
|
-
"has": {
|
|
195
|
-
"stopBy": "neighbor",
|
|
196
|
-
"not": {
|
|
197
|
-
"any": [
|
|
198
|
-
{
|
|
199
|
-
"matches": "string"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"regex": "^[\\[\\],]$"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"kind": "comment"
|
|
206
|
-
}
|
|
207
|
-
]
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
"string-pairs": {
|
|
213
|
-
"kind": "dictionary",
|
|
214
|
-
"not": {
|
|
215
|
-
"has": {
|
|
216
|
-
"stopBy": "neighbor",
|
|
217
|
-
"not": {
|
|
218
|
-
"any": [
|
|
219
|
-
{
|
|
220
|
-
"kind": "pair",
|
|
221
|
-
"not": {
|
|
222
|
-
"has": {
|
|
223
|
-
"stopBy": "neighbor",
|
|
224
|
-
"not": {
|
|
225
|
-
"any": [
|
|
226
|
-
{
|
|
227
|
-
"matches": "string"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"regex": "^:$"
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
"kind": "comment"
|
|
234
|
-
}
|
|
235
|
-
]
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
"regex": "^[{},]$"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"kind": "comment"
|
|
245
|
-
}
|
|
246
|
-
]
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
|
-
"violation": {
|
|
255
|
-
"anchor": "witness.span",
|
|
256
|
-
"code": "B610",
|
|
257
|
-
"message": "Bandit B610 (django-extra-used)",
|
|
258
|
-
"suppress": {
|
|
259
|
-
"nosec": {
|
|
260
|
-
"codes": [
|
|
261
|
-
"B610"
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
]
|
|
268
|
-
}
|