Skip to content

Commit

Permalink
Rename type xlang -> analyzer (#331)
Browse files Browse the repository at this point in the history
This is part of renaming the OCaml module `Xlang` to `Analyzer`. This
type name change doesn't change the data format because type names don't
occur in JSON data.

- [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.50.0.
See
https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades
	  Note that the types related to the semgrep-core JSON output or the
	  semgrep-core RPC do not need to be backward compatible!
  • Loading branch information
mjambon authored Jan 10, 2025
1 parent 632b1de commit 48eb841
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 95 deletions.
7 changes: 4 additions & 3 deletions semgrep_output_v1.atd
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,8 @@ type core_error <python decorator="dataclass(frozen=True)"> = {
those different files (because ATD does not have a proper module system yet).
*)

type xlang <ocaml attr="deriving show"> = string wrap <ocaml module="Xlang">
type analyzer <ocaml attr="deriving show"> =
string wrap <ocaml module="Analyzer">

(* A target can either be a traditional code target (now with optional
associated lockfile) or it can be a lockfile target, which will be used to
Expand All @@ -1889,10 +1890,10 @@ type target <ocaml attr="deriving show"> = [
*)
type code_target <ocaml attr="deriving show"> = {
path: fpath (* source file *);
(* Must be a valid target analyzer as defined in Xlang.mli.
(* Must be a valid target analyzer as defined in Analyzer.mli.
examples: "ocaml", "python", but also "spacegrep" or "regexp".
*)
analyzer: xlang;
analyzer: analyzer;
products: product list;
?lockfile_target: lockfile option;
}
Expand Down
4 changes: 2 additions & 2 deletions semgrep_output_v1.jsonschema

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion semgrep_output_v1.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 23 additions & 23 deletions semgrep_output_v1.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions semgrep_output_v1.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 37 additions & 37 deletions semgrep_output_v1_j.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 23 additions & 23 deletions semgrep_output_v1_j.mli

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48eb841

Please sign in to comment.