Skip to content

Commit 908e8c1

Browse files
authored
chore(sca): tweak unresolved version (#359)
Add "disabled" option to `UnresolvedReason` and make it a frozen dataclass so we can use it in sets and as a dictionary key in python - [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!
1 parent 571c38d commit 908e8c1

7 files changed

+49
-8
lines changed

semgrep_output_v1.atd

+8-1
Original file line numberDiff line numberDiff line change
@@ -2361,10 +2361,17 @@ type downloaded_dependency = {
23612361
source_path: fpath;
23622362
}
23632363

2364-
type unresolved_reason = [
2364+
type unresolved_reason <python decorator="dataclass(frozen=True)"> = [
2365+
(* Resolution was attempted, but was unsuccessful. *)
23652366
| UnresolvedFailed <json name="failed">
2367+
(* Resolution was skipped because the dependency source was not relevant to
2368+
* the scanned targets. *)
23662369
| UnresolvedSkipped <json name="skipped">
2370+
(* Resolution was skipped because the dependency source is not supported. *)
23672371
| UnresolvedUnsupported <json name="unsupported">
2372+
(* Resolution was not attempted because a required feature (such as local
2373+
* builds) was disabled. *)
2374+
| UnresolvedDisabled <json name="disabled">
23682375
] <ocaml repr="classic">
23692376

23702377
type unresolved_subproject

semgrep_output_v1.jsonschema

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.proto

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.py

+24-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1.ts

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1_j.ml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

semgrep_output_v1_j.mli

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)