11
11
* (see https://json-schema-everywhere.github.io/yaml).
12
12
*
13
13
* Jsonschema, used in rule_schema_v1.yml, is powerful but also arguably
14
- * complicated and so it might be simpler for many Semgrep developers
14
+ * complicated and so it might be simpler for many Semgrep developers
15
15
* (and also some Semgrep users) to use ATD to specify and understand the
16
16
* schema of a rule. It could provide a better basis to think about future
17
17
* syntax extensions.
@@ -103,7 +103,7 @@ type rule = {
103
103
?options: rule_options option;
104
104
105
105
(* TODO? impose more constraints on metadata? standard fields?
106
- * add a 'confidence:'? 'product:'?
106
+ * add a 'confidence:'? 'product:'?
107
107
*)
108
108
?metadata: raw_json option;
109
109
@@ -118,7 +118,7 @@ type rule_id = string wrap <ocaml module="Rule_ID">
118
118
(* Severity, language, selector, paths, fix_regex *)
119
119
(*****************************************************************************)
120
120
121
- (* coupling: semgrep_output_v1.atd with match_severity
121
+ (* coupling: semgrep_output_v1.atd with match_severity
122
122
* I've removed EXPERIMENT and INVENTORY which should not be used.
123
123
* TODO in v2 we should probably remove ERROR/WARNING superseded by
124
124
* HIGH/MEDIUM.
@@ -194,8 +194,8 @@ type language = [
194
194
| Vue <json name="vue">
195
195
| Yaml <json name="yaml">
196
196
197
- (* a.k.a., spacegrep and aliengrep
198
- * TODO? remove and replace with 'generic:' in formula?
197
+ (* a.k.a., spacegrep and aliengrep
198
+ * TODO? remove and replace with 'generic:' in formula?
199
199
*)
200
200
| Generic <json name="generic">
201
201
(* TODO remove? redundant with 'regex:' in formula? *)
@@ -347,6 +347,9 @@ type formula = {
347
347
(* TODO? ?taint: taint option; and ?steps: ? *)
348
348
349
349
?where: condition list option;
350
+
351
+ (* NEW: since 1.74 *)
352
+ ?fix: string option;
350
353
}
351
354
<json adapter.ocaml="Rule_schema_v2_adapter.Formula">
352
355
@@ -361,7 +364,7 @@ type pattern = string
361
364
* - metavariable: $X
362
365
* regex: $Z
363
366
* which when turned into JSON gives:
364
- * { where:
367
+ * { where:
365
368
* [ { metavariable: $X, regex: $Z } ]
366
369
* }
367
370
* which we must transform in an ATD-compliant:
@@ -385,7 +388,7 @@ type comparison = {
385
388
?strip: bool option;
386
389
}
387
390
388
- (* comparison expression with metavariables, ex: $X > 100
391
+ (* comparison expression with metavariables, ex: $X > 100
389
392
* (currently using a Python-like syntax)
390
393
*)
391
394
type comparison_expr = string
@@ -412,7 +415,7 @@ type metavariable_cond = {
412
415
?constant_propagation <json name="constant-propagation">: bool option;
413
416
414
417
?analyzer: analyzer option;
415
- }
418
+ }
416
419
417
420
type mvar = string
418
421
0 commit comments