Skip to content

Commit 1c70be3

Browse files
authored
Switch to ATD_string_wrap (#183)
test plan: see related PR in semgrep - [x] I ran `make setup && make` to update the generated code after editing a `.atd` file (TODO: have a CI check) - [x] 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 6f85df6 commit 1c70be3

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

rule_schema_v2.atd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type rule = {
6161
}
6262

6363
(* Rule_ID.t, "^[a-zA-Z0-9._-]*$" *)
64-
type rule_id = string wrap <ocaml module="ATDStringWrap.Ruleid">
64+
type rule_id = string wrap <ocaml module="Rule_ID">
6565

6666
(* Version_info.t *)
6767
type version = string (* TODO wrap <ocaml module="ATDStringWrap.Version"> *)

semgrep_metrics.atd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
(* Basic types *)
2121
(*****************************************************************************)
2222

23-
type uuid = string wrap <ocaml module="ATDStringWrap.Uuidm">
23+
type uuid = string wrap <ocaml module="ATD_string_wrap.Uuidm">
2424

25-
type sha256 = string wrap <ocaml module="ATDStringWrap.Sha256">
25+
type sha256 = string wrap <ocaml module="ATD_string_wrap.Sha256">
2626

2727
(* GMT time (in osemgrep at least), in isoformat *)
28-
type datetime = string wrap <ocaml module="ATDStringWrap.Datetime">
28+
type datetime = string wrap <ocaml module="ATD_string_wrap.Datetime">
2929

3030
type lang = string
3131

semgrep_output_v1.atd

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,15 @@ type raw_json <ocaml module="Yojson.Basic" t="t"> = abstract
7171
(*****************************************************************************)
7272

7373
(* File path. less: could convert directly to Path class of pathlib library for Python *)
74-
type fpath <ocaml attr="deriving show"> =
75-
string wrap <ocaml module="ATDStringWrap.Fpath">
74+
type fpath <ocaml attr="deriving show"> = string wrap <ocaml module="ATD_string_wrap.Fpath">
7675

77-
type uri = string wrap <ocaml module="ATDStringWrap.Uri">
76+
type uri = string wrap <ocaml module="ATD_string_wrap.Uri">
7877

79-
type sha1 = string wrap <ocaml module="ATDStringWrap.Sha1">
78+
type sha1 = string wrap <ocaml module="ATD_string_wrap.Sha1">
8079

81-
type uuid = string wrap <ocaml module="ATDStringWrap.Uuidm">
80+
type uuid = string wrap <ocaml module="ATD_string_wrap.Uuidm">
8281

83-
(* GMT time (in osemgrep at least), in isoformat, TODO ATDStringWrap.Datetime *)
82+
(* GMT time (in osemgrep at least), in isoformat, TODO ATD_string_wrap.Datetime *)
8483
type datetime = string
8584

8685
(*****************************************************************************)
@@ -124,7 +123,7 @@ type location
124123
type rule_id
125124
<ocaml attr="deriving show">
126125
<python decorator="dataclass(frozen=True)"> =
127-
string wrap <ocaml module="ATDStringWrap.Ruleid">
126+
string wrap <ocaml module="Rule_ID">
128127

129128
(*
130129
Error = something wrong that must be fixed
@@ -1329,4 +1328,3 @@ type ci_scan_failure = {
13291328
exit_code: int;
13301329
stderr: string;
13311330
}
1332-

0 commit comments

Comments
 (0)