Skip to content

Commit 5edc244

Browse files
committed
update rule schema atd for fix
1 parent 9f38254 commit 5edc244

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

rule_schema_v2.atd

+11-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* (see https://json-schema-everywhere.github.io/yaml).
1212
*
1313
* 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
1515
* (and also some Semgrep users) to use ATD to specify and understand the
1616
* schema of a rule. It could provide a better basis to think about future
1717
* syntax extensions.
@@ -103,7 +103,7 @@ type rule = {
103103
?options: rule_options option;
104104

105105
(* TODO? impose more constraints on metadata? standard fields?
106-
* add a 'confidence:'? 'product:'?
106+
* add a 'confidence:'? 'product:'?
107107
*)
108108
?metadata: raw_json option;
109109

@@ -118,7 +118,7 @@ type rule_id = string wrap <ocaml module="Rule_ID">
118118
(* Severity, language, selector, paths, fix_regex *)
119119
(*****************************************************************************)
120120

121-
(* coupling: semgrep_output_v1.atd with match_severity
121+
(* coupling: semgrep_output_v1.atd with match_severity
122122
* I've removed EXPERIMENT and INVENTORY which should not be used.
123123
* TODO in v2 we should probably remove ERROR/WARNING superseded by
124124
* HIGH/MEDIUM.
@@ -194,8 +194,8 @@ type language = [
194194
| Vue <json name="vue">
195195
| Yaml <json name="yaml">
196196

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?
199199
*)
200200
| Generic <json name="generic">
201201
(* TODO remove? redundant with 'regex:' in formula? *)
@@ -347,6 +347,9 @@ type formula = {
347347
(* TODO? ?taint: taint option; and ?steps: ? *)
348348

349349
?where: condition list option;
350+
351+
(* NEW: since 1.74 *)
352+
?fix: string option;
350353
}
351354
<json adapter.ocaml="Rule_schema_v2_adapter.Formula">
352355

@@ -361,7 +364,7 @@ type pattern = string
361364
* - metavariable: $X
362365
* regex: $Z
363366
* which when turned into JSON gives:
364-
* { where:
367+
* { where:
365368
* [ { metavariable: $X, regex: $Z } ]
366369
* }
367370
* which we must transform in an ATD-compliant:
@@ -385,7 +388,7 @@ type comparison = {
385388
?strip: bool option;
386389
}
387390

388-
(* comparison expression with metavariables, ex: $X > 100
391+
(* comparison expression with metavariables, ex: $X > 100
389392
* (currently using a Python-like syntax)
390393
*)
391394
type comparison_expr = string
@@ -412,7 +415,7 @@ type metavariable_cond = {
412415
?constant_propagation <json name="constant-propagation">: bool option;
413416

414417
?analyzer: analyzer option;
415-
}
418+
}
416419

417420
type mvar = string
418421

0 commit comments

Comments
 (0)