Skip to content

Commit 6eadab9

Browse files
committed
BannedSyntax: assign scope to each query
1 parent 1e57782 commit 6eadab9

18 files changed

+52
-18
lines changed

cpp/autosar/src/rules/A11-3-1/FriendDeclarationsUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @tags external/autosar/id/a11-3-1
99
* correctness
1010
* security
11+
* scope/single-translation-unit
1112
* external/autosar/allocated-target/implementation
1213
* external/autosar/enforcement/automated
1314
* external/autosar/obligation/required

cpp/autosar/src/rules/A18-1-1/CStyleArraysUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @problem.severity error
99
* @tags external/autosar/id/a18-1-1
1010
* correctness
11+
* scope/single-translation-unit
1112
* external/autosar/allocated-target/implementation
1213
* external/autosar/enforcement/automated
1314
* external/autosar/obligation/required

cpp/autosar/src/rules/A2-11-1/VolatileKeywordUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @problem.severity error
88
* @tags external/autosar/id/a2-11-1
99
* correctness
10+
* scope/single-translation-unit
1011
* external/autosar/allocated-target/design
1112
* external/autosar/allocated-target/implementation
1213
* external/autosar/enforcement/automated

cpp/autosar/src/rules/A5-16-1/TernaryConditionalOperatorUsedAsSubExpression.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @problem.severity error
99
* @tags external/autosar/id/a5-16-1
1010
* correctness
11+
* scope/single-translation-unit
1112
* external/autosar/allocated-target/implementation
1213
* external/autosar/enforcement/automated
1314
* external/autosar/obligation/required

cpp/autosar/src/rules/A5-2-1/DynamicCastShouldNotBeUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @problem.severity error
88
* @tags external/autosar/id/a5-2-1
99
* correctness
10+
* scope/single-translation-unit
1011
* external/autosar/allocated-target/implementation
1112
* external/autosar/enforcement/automated
1213
* external/autosar/obligation/advisory

cpp/autosar/src/rules/A5-2-2/TraditionalCStyleCastsUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @problem.severity error
88
* @tags external/autosar/id/a5-2-2
99
* correctness
10+
* scope/single-translation-unit
1011
* external/autosar/allocated-target/implementation
1112
* external/autosar/enforcement/automated
1213
* external/autosar/obligation/required

cpp/autosar/src/rules/A5-2-4/ReinterpretCastUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @tags external/autosar/id/a5-2-4
99
* correctness
1010
* security
11+
* scope/single-translation-unit
1112
* external/autosar/allocated-target/implementation
1213
* external/autosar/enforcement/automated
1314
* external/autosar/obligation/required

cpp/autosar/src/rules/A6-6-1/GotoStatementUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @tags external/autosar/id/a6-6-1
99
* correctness
1010
* security
11+
* scope/single-translation-unit
1112
* external/autosar/allocated-target/implementation
1213
* external/autosar/enforcement/automated
1314
* external/autosar/obligation/required

cpp/autosar/src/rules/A7-1-4/RegisterKeywordUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @problem.severity error
88
* @tags external/autosar/id/a7-1-4
99
* correctness
10+
* scope/single-translation-unit
1011
* external/autosar/allocated-target/implementation
1112
* external/autosar/enforcement/automated
1213
* external/autosar/obligation/required

cpp/autosar/src/rules/A7-1-6/TypedefSpecifierUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @problem.severity error
88
* @tags external/autosar/id/a7-1-6
99
* correctness
10+
* scope/single-translation-unit
1011
* external/autosar/allocated-target/implementation
1112
* external/autosar/enforcement/automated
1213
* external/autosar/obligation/required

cpp/autosar/src/rules/A7-4-1/AsmDeclarationUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @problem.severity error
88
* @tags external/autosar/id/a7-4-1
99
* correctness
10+
* scope/single-translation-unit
1011
* external/autosar/allocated-target/implementation
1112
* external/autosar/enforcement/automated
1213
* external/autosar/obligation/required

cpp/autosar/src/rules/A8-4-1/FunctionsDefinedUsingTheEllipsisNotation.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @tags external/autosar/id/a8-4-1
99
* correctness
1010
* security
11+
* scope/single-translation-unit
1112
* external/autosar/allocated-target/implementation
1213
* external/autosar/enforcement/automated
1314
* external/autosar/obligation/required

cpp/autosar/src/rules/A9-5-1/UnionsUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @problem.severity error
99
* @tags external/autosar/id/a9-5-1
1010
* correctness
11+
* scope/single-translation-unit
1112
* external/autosar/allocated-target/implementation
1213
* external/autosar/enforcement/automated
1314
* external/autosar/obligation/required

cpp/autosar/src/rules/M5-18-1/CommaOperatorUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @problem.severity error
88
* @tags external/autosar/id/m5-18-1
99
* correctness
10+
* scope/single-translation-unit
1011
* external/autosar/allocated-target/implementation
1112
* external/autosar/enforcement/automated
1213
* external/autosar/obligation/required

cpp/autosar/src/rules/M7-3-4/UsingDirectivesUsed.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @problem.severity error
88
* @tags external/autosar/id/m7-3-4
99
* correctness
10+
* scope/single-translation-unit
1011
* external/autosar/allocated-target/implementation
1112
* external/autosar/enforcement/automated
1213
* external/autosar/obligation/required

cpp/autosar/src/rules/M7-3-6/UsingDeclarationsUsedInHeaderFiles.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @problem.severity error
99
* @tags external/autosar/id/m7-3-6
1010
* correctness
11+
* scope/single-translation-unit
1112
* external/autosar/allocated-target/implementation
1213
* external/autosar/enforcement/automated
1314
* external/autosar/obligation/required

cpp/cert/src/rules/DCL50-CPP/DoNotDefineACStyleVariadicFunction.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @tags external/cert/id/dcl50-cpp
99
* correctness
1010
* security
11+
* scope/single-translation-unit
1112
* external/cert/obligation/rule
1213
*/
1314

rule_packages/cpp/BannedSyntax.json

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"short_name": "FriendDeclarationsUsed",
1919
"tags": [
2020
"correctness",
21-
"security"
21+
"security",
22+
"scope/single-translation-unit"
2223
]
2324
}
2425
],
@@ -41,7 +42,8 @@
4142
"severity": "error",
4243
"short_name": "CStyleArraysUsed",
4344
"tags": [
44-
"correctness"
45+
"correctness",
46+
"scope/single-translation-unit"
4547
]
4648
}
4749
],
@@ -65,7 +67,8 @@
6567
"severity": "error",
6668
"short_name": "VolatileKeywordUsed",
6769
"tags": [
68-
"correctness"
70+
"correctness",
71+
"scope/single-translation-unit"
6972
]
7073
}
7174
],
@@ -88,7 +91,8 @@
8891
"severity": "error",
8992
"short_name": "TernaryConditionalOperatorUsedAsSubExpression",
9093
"tags": [
91-
"correctness"
94+
"correctness",
95+
"scope/single-translation-unit"
9296
]
9397
}
9498
],
@@ -111,7 +115,8 @@
111115
"severity": "error",
112116
"short_name": "DynamicCastShouldNotBeUsed",
113117
"tags": [
114-
"correctness"
118+
"correctness",
119+
"scope/single-translation-unit"
115120
]
116121
}
117122
],
@@ -134,7 +139,8 @@
134139
"severity": "error",
135140
"short_name": "TraditionalCStyleCastsUsed",
136141
"tags": [
137-
"correctness"
142+
"correctness",
143+
"scope/single-translation-unit"
138144
]
139145
}
140146
],
@@ -158,7 +164,8 @@
158164
"short_name": "ReinterpretCastUsed",
159165
"tags": [
160166
"correctness",
161-
"security"
167+
"security",
168+
"scope/single-translation-unit"
162169
]
163170
}
164171
],
@@ -182,7 +189,8 @@
182189
"short_name": "GotoStatementUsed",
183190
"tags": [
184191
"correctness",
185-
"security"
192+
"security",
193+
"scope/single-translation-unit"
186194
]
187195
}
188196
],
@@ -205,7 +213,8 @@
205213
"severity": "error",
206214
"short_name": "RegisterKeywordUsed",
207215
"tags": [
208-
"correctness"
216+
"correctness",
217+
"scope/single-translation-unit"
209218
]
210219
}
211220
],
@@ -228,7 +237,8 @@
228237
"severity": "error",
229238
"short_name": "TypedefSpecifierUsed",
230239
"tags": [
231-
"correctness"
240+
"correctness",
241+
"scope/single-translation-unit"
232242
]
233243
}
234244
],
@@ -251,7 +261,8 @@
251261
"severity": "error",
252262
"short_name": "AsmDeclarationUsed",
253263
"tags": [
254-
"correctness"
264+
"correctness",
265+
"scope/single-translation-unit"
255266
]
256267
}
257268
],
@@ -275,7 +286,8 @@
275286
"short_name": "FunctionsDefinedUsingTheEllipsisNotation",
276287
"tags": [
277288
"correctness",
278-
"security"
289+
"security",
290+
"scope/single-translation-unit"
279291
]
280292
}
281293
],
@@ -298,7 +310,8 @@
298310
"severity": "error",
299311
"short_name": "UnionsUsed",
300312
"tags": [
301-
"correctness"
313+
"correctness",
314+
"scope/single-translation-unit"
302315
]
303316
}
304317
],
@@ -322,7 +335,8 @@
322335
"short_name": "CommaOperatorUsed",
323336
"shared_implementation_short_name": "CommaOperatorUsed",
324337
"tags": [
325-
"correctness"
338+
"correctness",
339+
"scope/single-translation-unit"
326340
]
327341
}
328342
],
@@ -345,7 +359,8 @@
345359
"severity": "error",
346360
"short_name": "UsingDirectivesUsed",
347361
"tags": [
348-
"correctness"
362+
"correctness",
363+
"scope/single-translation-unit"
349364
]
350365
}
351366
],
@@ -368,7 +383,8 @@
368383
"severity": "error",
369384
"short_name": "UsingDeclarationsUsedInHeaderFiles",
370385
"tags": [
371-
"correctness"
386+
"correctness",
387+
"scope/single-translation-unit"
372388
]
373389
}
374390
],
@@ -390,11 +406,12 @@
390406
"short_name": "DoNotDefineACStyleVariadicFunction",
391407
"tags": [
392408
"correctness",
393-
"security"
409+
"security",
410+
"scope/single-translation-unit"
394411
]
395412
}
396413
],
397414
"title": "Do not define a C-style variadic function"
398415
}
399416
}
400-
}
417+
}

0 commit comments

Comments
 (0)