Skip to content

Commit 9e95398

Browse files
authored
stuff (#193)
- [ ] I ran `make setup && make` to update the generated code after editing a `.atd` file (TODO: have a CI check) - [ ] I made sure we're still backward compatible with old versions of the CLI. For example, the Semgrep backend need to still be able to *consume* data generated by Semgrep 1.17.0. See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades
1 parent 0ba2bca commit 9e95398

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

rule_schema_v2.atd

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ type rule = {
100100
*)
101101
?metadata: raw_json option;
102102

103-
?min_version: version option;
104-
?max_version: version option;
103+
?min_version <json name="min-version">: version option;
104+
?max_version <json name="max-version">: version option;
105105
}
106106

107107
(* Rule_ID.t, "^[a-zA-Z0-9._-]*$" *)
@@ -356,19 +356,25 @@ type comparison = {
356356
type metavariable_cond = {
357357
metavariable: mvar;
358358

359-
(* CHECK: exactly one of those fields must be set *)
359+
(* CHECK: exactly one of type/types/analyzer/formula(all/any/...) *)
360+
360361
?type_ <json name="type">: string option;
361362
?types: string list option;
362-
(* this covers regex:, pattern:, but also any formula.
363-
* TODO: for metavariable-regex, can also enable constant_propagation
364-
* TOOD: we should accept also language: string
363+
364+
(* this covers regex:/pattern:, but also all:/any: with optional where:
365+
* CHECK: language is valid only when combined with a formula
366+
* CHECK: constant_propagation: is valid only when combined with regex:
365367
*)
366368
inherit formula;
369+
?language: language option;
370+
?constant_propagation <json name="constant-propagation">: bool option;
371+
367372
?analyzer: analyzer option;
368373
}
369374

370375
type analyzer = [
371376
| Entropy <json name="entropy">
377+
| EntropyV2 <json name="entropy_v2">
372378
| Redos <json name="redos">
373379
]
374380

0 commit comments

Comments
 (0)