diff --git a/Makefile b/Makefile index 1c599bd..2c4166d 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ FILES= \ semgrep_output_$(VER).ts \ semgrep_output_$(VER).jsonschema \ semgrep_output_$(VER).proto \ + ast_generic_$(VER).py \ ast_generic_$(VER)_j.ml \ ast_generic_$(VER)_j.mli \ Language.ml \ diff --git a/ast_generic_v1.atd b/ast_generic_v1.atd index 1884a88..991ea75 100644 --- a/ast_generic_v1.atd +++ b/ast_generic_v1.atd @@ -966,7 +966,7 @@ type directive = [ | ImportFrom of ( tok (* 'import'/'from' for Python, 'include' for C *) * module_name - * (ident * alias nullable (* as name alias *)) list + * import_from_kind list ) | ImportAs of (tok * module_name * alias nullable) (* as name *) @@ -987,6 +987,11 @@ type directive = [ (* ... as name *) type alias = (ident * id_info) +type import_from_kind = [ + | Direct of alias + | Aliased of (ident * alias) + ] + (*****************************************************************************) (* Toplevel *) (*****************************************************************************) diff --git a/ast_generic_v1.py b/ast_generic_v1.py index e68b368..1a69cbd 100644 --- a/ast_generic_v1.py +++ b/ast_generic_v1.py @@ -9,7 +9,7 @@ # Import annotations to allow forward references from __future__ import annotations -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import Any, Callable, Dict, List, NoReturn, Optional, Tuple, Union import json @@ -137,6 +137,19 @@ def read_nullable(x: Any) -> Any: return read_nullable +def _atd_read_option(read_elt: Callable[[Any], Any]) \ + -> Callable[[Optional[Any]], Optional[Any]]: + def read_option(x: Any) -> Any: + if x == 'None': + return None + elif isinstance(x, List) and len(x) == 2 and x[0] == 'Some': + return read_elt(x[1]) + else: + _atd_bad_json('option', x) + raise AssertionError('impossible') # keep mypy happy + return read_option + + def _atd_write_unit(x: Any) -> None: if x is None: return x @@ -232,6 +245,16 @@ def write_nullable(x: Any) -> Any: return write_nullable +def _atd_write_option(write_elt: Callable[[Any], Any]) \ + -> Callable[[Optional[Any]], Optional[Any]]: + def write_option(x: Any) -> Any: + if x is None: + return 'None' + else: + return ['Some', write_elt(x)] + return write_option + + ############################################################################ # Public classes ############################################################################ @@ -2307,6 +2330,7 @@ def to_json() -> Any: def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) + @dataclass class LDA: """Original type: operator = [ ... | LDA | ... ]""" @@ -2323,6 +2347,7 @@ def to_json() -> Any: def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) + @dataclass class RDA: """Original type: operator = [ ... | RDA | ... ]""" @@ -2339,6 +2364,7 @@ def to_json() -> Any: def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) + @dataclass class LSA: """Original type: operator = [ ... | LSA | ... ]""" @@ -2355,6 +2381,7 @@ def to_json() -> Any: def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) + @dataclass class RSA: """Original type: operator = [ ... | RSA | ... ]""" @@ -2619,6 +2646,23 @@ def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) +@dataclass +class Cls: + """Original type: special = [ ... | Cls | ... ]""" + + @property + def kind(self) -> str: + """Name of the class representing this variant.""" + return 'Cls' + + @staticmethod + def to_json() -> Any: + return 'Cls' + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + @dataclass class Self: """Original type: special = [ ... | Self | ... ]""" @@ -2917,7 +2961,7 @@ def to_json_string(self, **kw: Any) -> str: class Special: """Original type: special = [ ... ]""" - value: Union[This, Super, Self, Parent, Eval, Typeof, Instanceof, Sizeof, Defined, ConcatString, EncodedString, InterpolatedElement, Spread, HashSplat, ForOf, Op, IncrDecr_, Require, OtherSpecial] + value: Union[This, Super, Cls, Self, Parent, Eval, Typeof, Instanceof, Sizeof, Defined, ConcatString, EncodedString, InterpolatedElement, Spread, HashSplat, ForOf, Op, IncrDecr_, Require, OtherSpecial] @property def kind(self) -> str: @@ -2931,6 +2975,8 @@ def from_json(cls, x: Any) -> 'Special': return cls(This()) if x == 'Super': return cls(Super()) + if x == 'Cls': + return cls(Cls()) if x == 'Self': return cls(Self()) if x == 'Parent': @@ -3196,27 +3242,6 @@ def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) -@dataclass -class IntNullableWrap: - """Original type: _int_nullable_wrap""" - - value: Tuple[Optional[int], Tok] - - @classmethod - def from_json(cls, x: Any) -> 'IntNullableWrap': - return cls((lambda x: (_atd_read_nullable(_atd_read_int)(x[0]), Tok.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x)) - - def to_json(self) -> Any: - return (lambda x: [_atd_write_nullable(_atd_write_int)(x[0]), (lambda x: x.to_json())(x[1])] if isinstance(x, tuple) and len(x) == 2 else _atd_bad_python('tuple of length 2', x))(self.value) - - @classmethod - def from_json_string(cls, x: str) -> 'IntNullableWrap': - return cls.from_json(json.loads(x)) - - def to_json_string(self, **kw: Any) -> str: - return json.dumps(self.to_json(), **kw) - - @dataclass class IntWrap: """Original type: _int_wrap""" @@ -3343,6 +3368,27 @@ def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) +@dataclass +class XB40703a: + """Original type: _x_b40703a""" + + value: Tuple[Optional[int], Tok] + + @classmethod + def from_json(cls, x: Any) -> 'XB40703a': + return cls((lambda x: (_atd_read_nullable(_atd_read_int)(x[0]), Tok.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x)) + + def to_json(self) -> Any: + return (lambda x: [_atd_write_nullable(_atd_write_int)(x[0]), (lambda x: x.to_json())(x[1])] if isinstance(x, tuple) and len(x) == 2 else _atd_bad_python('tuple of length 2', x))(self.value) + + @classmethod + def from_json_string(cls, x: str) -> 'XB40703a': + return cls.from_json(json.loads(x)) + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + @dataclass class Ident: """Original type: ident""" @@ -3428,7 +3474,7 @@ def to_json_string(self, **kw: Any) -> str: class Int: """Original type: literal = [ ... | Int of ... | ... ]""" - value: IntNullableWrap + value: XB40703a @property def kind(self) -> str: @@ -3640,7 +3686,7 @@ def from_json(cls, x: Any) -> 'Literal': if cons == 'Bool': return cls(Bool(BoolWrap.from_json(x[1]))) if cons == 'Int': - return cls(Int(IntNullableWrap.from_json(x[1]))) + return cls(Int(XB40703a.from_json(x[1]))) if cons == 'Float': return cls(Float(FloatNullableWrap.from_json(x[1]))) if cons == 'Char': @@ -5761,7 +5807,7 @@ def to_json_string(self, **kw: Any) -> str: class ImportFrom: """Original type: directive = [ ... | ImportFrom of ... | ... ]""" - value: Tuple[Tok, ModuleName, List[Tuple[Ident, Optional[Alias]]]] + value: Tuple[Tok, ModuleName, List[ImportFromKind]] @property def kind(self) -> str: @@ -5769,7 +5815,7 @@ def kind(self) -> str: return 'ImportFrom' def to_json(self) -> Any: - return ['ImportFrom', (lambda x: [(lambda x: x.to_json())(x[0]), (lambda x: x.to_json())(x[1]), _atd_write_list((lambda x: [(lambda x: x.to_json())(x[0]), _atd_write_nullable((lambda x: x.to_json()))(x[1])] if isinstance(x, tuple) and len(x) == 2 else _atd_bad_python('tuple of length 2', x)))(x[2])] if isinstance(x, tuple) and len(x) == 3 else _atd_bad_python('tuple of length 3', x))(self.value)] + return ['ImportFrom', (lambda x: [(lambda x: x.to_json())(x[0]), (lambda x: x.to_json())(x[1]), _atd_write_list((lambda x: x.to_json()))(x[2])] if isinstance(x, tuple) and len(x) == 3 else _atd_bad_python('tuple of length 3', x))(self.value)] def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) @@ -5899,7 +5945,7 @@ def from_json(cls, x: Any) -> 'Directive': if isinstance(x, List) and len(x) == 2: cons = x[0] if cons == 'ImportFrom': - return cls(ImportFrom((lambda x: (Tok.from_json(x[0]), ModuleName.from_json(x[1]), _atd_read_list((lambda x: (Ident.from_json(x[0]), _atd_read_nullable(Alias.from_json)(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x)))(x[2])) if isinstance(x, list) and len(x) == 3 else _atd_bad_json('array of length 3', x))(x[1]))) + return cls(ImportFrom((lambda x: (Tok.from_json(x[0]), ModuleName.from_json(x[1]), _atd_read_list(ImportFromKind.from_json)(x[2])) if isinstance(x, list) and len(x) == 3 else _atd_bad_json('array of length 3', x))(x[1]))) if cons == 'ImportAs': return cls(ImportAs((lambda x: (Tok.from_json(x[0]), ModuleName.from_json(x[1]), _atd_read_nullable(Alias.from_json)(x[2])) if isinstance(x, list) and len(x) == 3 else _atd_bad_json('array of length 3', x))(x[1]))) if cons == 'ImportAll': @@ -7285,6 +7331,74 @@ def from_json_string(cls, x: str) -> 'IdInfo': def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) +@dataclass +class Direct: + """Original type: import_from_kind = [ ... | Direct of ... | ... ]""" + + value: Alias + + @property + def kind(self) -> str: + """Name of the class representing this variant.""" + return 'Direct' + + def to_json(self) -> Any: + return ['Direct', (lambda x: x.to_json())(self.value)] + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + +@dataclass +class Aliased: + """Original type: import_from_kind = [ ... | Aliased of ... | ... ]""" + + value: Tuple[Ident, Alias] + + @property + def kind(self) -> str: + """Name of the class representing this variant.""" + return 'Aliased' + + def to_json(self) -> Any: + return ['Aliased', (lambda x: [(lambda x: x.to_json())(x[0]), (lambda x: x.to_json())(x[1])] if isinstance(x, tuple) and len(x) == 2 else _atd_bad_python('tuple of length 2', x))(self.value)] + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + +@dataclass +class ImportFromKind: + """Original type: import_from_kind = [ ... ]""" + + value: Union[Direct, Aliased] + + @property + def kind(self) -> str: + """Name of the class representing this variant.""" + return self.value.kind + + @classmethod + def from_json(cls, x: Any) -> 'ImportFromKind': + if isinstance(x, List) and len(x) == 2: + cons = x[0] + if cons == 'Direct': + return cls(Direct(Alias.from_json(x[1]))) + if cons == 'Aliased': + return cls(Aliased((lambda x: (Ident.from_json(x[0]), Alias.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x[1]))) + _atd_bad_json('ImportFromKind', x) + _atd_bad_json('ImportFromKind', x) + + def to_json(self) -> Any: + return self.value.to_json() + + @classmethod + def from_json_string(cls, x: str) -> 'ImportFromKind': + return cls.from_json(json.loads(x)) + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + @dataclass class Item: """Original type: item""" @@ -8117,18 +8231,18 @@ def to_json_string(self, **kw: Any) -> str: @dataclass -class PatUnderscore: - """Original type: pattern = [ ... | PatUnderscore of ... | ... ]""" +class PatWildcard: + """Original type: pattern = [ ... | PatWildcard of ... | ... ]""" value: Tok @property def kind(self) -> str: """Name of the class representing this variant.""" - return 'PatUnderscore' + return 'PatWildcard' def to_json(self) -> Any: - return ['PatUnderscore', (lambda x: x.to_json())(self.value)] + return ['PatWildcard', (lambda x: x.to_json())(self.value)] def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) @@ -8246,7 +8360,7 @@ def to_json_string(self, **kw: Any) -> str: class Pattern: """Original type: pattern = [ ... ]""" - value: Union[PatLiteral, PatConstructor, PatRecord, PatId, PatTuple, PatList, PatKeyVal, PatUnderscore, PatDisj, PatTyped, PatWhen, PatAs, PatType, OtherPat] + value: Union[PatLiteral, PatConstructor, PatRecord, PatId, PatTuple, PatList, PatKeyVal, PatWildcard, PatDisj, PatTyped, PatWhen, PatAs, PatType, OtherPat] @property def kind(self) -> str: @@ -8271,8 +8385,8 @@ def from_json(cls, x: Any) -> 'Pattern': return cls(PatList(PatternListBracket.from_json(x[1]))) if cons == 'PatKeyVal': return cls(PatKeyVal((lambda x: (Pattern.from_json(x[0]), Pattern.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x[1]))) - if cons == 'PatUnderscore': - return cls(PatUnderscore(Tok.from_json(x[1]))) + if cons == 'PatWildcard': + return cls(PatWildcard(Tok.from_json(x[1]))) if cons == 'PatDisj': return cls(PatDisj((lambda x: (Pattern.from_json(x[0]), Pattern.from_json(x[1])) if isinstance(x, list) and len(x) == 2 else _atd_bad_json('array of length 2', x))(x[1]))) if cons == 'PatTyped': diff --git a/ast_generic_v1_j.ml b/ast_generic_v1_j.ml index 682c5d8..040de46 100644 --- a/ast_generic_v1_j.ml +++ b/ast_generic_v1_j.ml @@ -144,6 +144,8 @@ and id_info = Ast_generic_v1_t.id_info = { id_svalue: svalue option } +and import_from_kind = Ast_generic_v1_t.import_from_kind + and item = Ast_generic_v1_t.item and label_ident = Ast_generic_v1_t.label_ident @@ -4930,7 +4932,7 @@ and string_of__for_var_or_expr_list ?(len = 1024) x = let ob = Buffer.create len in write__for_var_or_expr_list ob x; Buffer.contents ob -and write__ident_alias_nullable_list ob x = ( +and write__ident_type_arguments_nullable_list ob x = ( Atdgen_runtime.Oj_run.write_list ( fun ob x -> Buffer.add_char ob '['; @@ -4942,37 +4944,24 @@ and write__ident_alias_nullable_list ob x = ( Buffer.add_char ob ','; (let _, x = x in ( - write__alias_nullable + write__type_arguments_nullable ) ob x ); Buffer.add_char ob ']'; ) ) ob x -and string_of__ident_alias_nullable_list ?(len = 1024) x = +and string_of__ident_type_arguments_nullable_list ?(len = 1024) x = let ob = Buffer.create len in - write__ident_alias_nullable_list ob x; + write__ident_type_arguments_nullable_list ob x; Buffer.contents ob -and write__ident_type_arguments_nullable_list ob x = ( +and write__import_from_kind_list ob x = ( Atdgen_runtime.Oj_run.write_list ( - fun ob x -> - Buffer.add_char ob '['; - (let x, _ = x in - ( - write_ident - ) ob x - ); - Buffer.add_char ob ','; - (let _, x = x in - ( - write__type_arguments_nullable - ) ob x - ); - Buffer.add_char ob ']'; + write_import_from_kind ) ) ob x -and string_of__ident_type_arguments_nullable_list ?(len = 1024) x = +and string_of__import_from_kind_list ?(len = 1024) x = let ob = Buffer.create len in - write__ident_type_arguments_nullable_list ob x; + write__import_from_kind_list ob x; Buffer.contents ob and write__item_list ob x = ( Atdgen_runtime.Oj_run.write_list ( @@ -5963,7 +5952,7 @@ and write_directive = ( Buffer.add_char ob ','; (let _, _, x = x in ( - write__ident_alias_nullable_list + write__import_from_kind_list ) ob x ); Buffer.add_char ob ']'; @@ -7000,6 +6989,39 @@ and string_of_id_info ?(len = 1024) x = let ob = Buffer.create len in write_id_info ob x; Buffer.contents ob +and write_import_from_kind = ( + fun ob x -> + match x with + | `Direct x -> + Buffer.add_string ob "[\"Direct\","; + ( + write_alias + ) ob x; + Buffer.add_char ob ']' + | `Aliased x -> + Buffer.add_string ob "[\"Aliased\","; + ( + fun ob x -> + Buffer.add_char ob '['; + (let x, _ = x in + ( + write_ident + ) ob x + ); + Buffer.add_char ob ','; + (let _, x = x in + ( + write_alias + ) ob x + ); + Buffer.add_char ob ']'; + ) ob x; + Buffer.add_char ob ']' +) +and string_of_import_from_kind ?(len = 1024) x = + let ob = Buffer.create len in + write_import_from_kind ob x; + Buffer.contents ob and write_item ob x = ( write_stmt ) ob x @@ -9621,54 +9643,6 @@ and read__for_var_or_expr_list p lb = ( ) p lb and _for_var_or_expr_list_of_string s = read__for_var_or_expr_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -and read__ident_alias_nullable_list p lb = ( - Atdgen_runtime.Oj_run.read_list ( - fun p lb -> - Yojson.Safe.read_space p lb; - let std_tuple = Yojson.Safe.start_any_tuple p lb in - let len = ref 0 in - let end_of_tuple = ref false in - (try - let x0 = - let x = - ( - read_ident - ) p lb - in - incr len; - Yojson.Safe.read_space p lb; - Yojson.Safe.read_tuple_sep2 p std_tuple lb; - x - in - let x1 = - let x = - ( - read__alias_nullable - ) p lb - in - incr len; - (try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_tuple_sep2 p std_tuple lb; - with Yojson.End_of_tuple -> end_of_tuple := true); - x - in - if not !end_of_tuple then ( - try - while true do - Yojson.Safe.skip_json p lb; - Yojson.Safe.read_space p lb; - Yojson.Safe.read_tuple_sep2 p std_tuple lb; - done - with Yojson.End_of_tuple -> () - ); - (x0, x1) - with Yojson.End_of_tuple -> - Atdgen_runtime.Oj_run.missing_tuple_fields p !len [ 0; 1 ]); - ) -) p lb -and _ident_alias_nullable_list_of_string s = - read__ident_alias_nullable_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) and read__ident_type_arguments_nullable_list p lb = ( Atdgen_runtime.Oj_run.read_list ( fun p lb -> @@ -9717,6 +9691,13 @@ and read__ident_type_arguments_nullable_list p lb = ( ) p lb and _ident_type_arguments_nullable_list_of_string s = read__ident_type_arguments_nullable_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +and read__import_from_kind_list p lb = ( + Atdgen_runtime.Oj_run.read_list ( + read_import_from_kind + ) +) p lb +and _import_from_kind_list_of_string s = + read__import_from_kind_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) and read__item_list p lb = ( Atdgen_runtime.Oj_run.read_list ( read_item @@ -13029,7 +13010,7 @@ and read_directive = ( let x2 = let x = ( - read__ident_alias_nullable_list + read__import_from_kind_list ) p lb in incr len; @@ -13383,7 +13364,7 @@ and read_directive = ( let x2 = let x = ( - read__ident_alias_nullable_list + read__import_from_kind_list ) p lb in incr len; @@ -17780,6 +17761,150 @@ and read_id_info = ( ) and id_info_of_string s = read_id_info (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +and read_import_from_kind = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "Direct" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_alias + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Direct x + | "Aliased" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + fun p lb -> + Yojson.Safe.read_space p lb; + let std_tuple = Yojson.Safe.start_any_tuple p lb in + let len = ref 0 in + let end_of_tuple = ref false in + (try + let x0 = + let x = + ( + read_ident + ) p lb + in + incr len; + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + x + in + let x1 = + let x = + ( + read_alias + ) p lb + in + incr len; + (try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + with Yojson.End_of_tuple -> end_of_tuple := true); + x + in + if not !end_of_tuple then ( + try + while true do + Yojson.Safe.skip_json p lb; + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + done + with Yojson.End_of_tuple -> () + ); + (x0, x1) + with Yojson.End_of_tuple -> + Atdgen_runtime.Oj_run.missing_tuple_fields p !len [ 0; 1 ]); + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Aliased x + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Direct" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_alias + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + `Direct x + | "Aliased" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + fun p lb -> + Yojson.Safe.read_space p lb; + let std_tuple = Yojson.Safe.start_any_tuple p lb in + let len = ref 0 in + let end_of_tuple = ref false in + (try + let x0 = + let x = + ( + read_ident + ) p lb + in + incr len; + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + x + in + let x1 = + let x = + ( + read_alias + ) p lb + in + incr len; + (try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + with Yojson.End_of_tuple -> end_of_tuple := true); + x + in + if not !end_of_tuple then ( + try + while true do + Yojson.Safe.skip_json p lb; + Yojson.Safe.read_space p lb; + Yojson.Safe.read_tuple_sep2 p std_tuple lb; + done + with Yojson.End_of_tuple -> () + ); + (x0, x1) + with Yojson.End_of_tuple -> + Atdgen_runtime.Oj_run.missing_tuple_fields p !len [ 0; 1 ]); + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + `Aliased x + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) +and import_from_kind_of_string s = + read_import_from_kind (Yojson.Safe.init_lexer ()) (Lexing.from_string s) and read_item p lb = ( read_stmt ) p lb diff --git a/ast_generic_v1_j.mli b/ast_generic_v1_j.mli index b1e7904..503d739 100644 --- a/ast_generic_v1_j.mli +++ b/ast_generic_v1_j.mli @@ -144,6 +144,8 @@ and id_info = Ast_generic_v1_t.id_info = { id_svalue: svalue option } +and import_from_kind = Ast_generic_v1_t.import_from_kind + and item = Ast_generic_v1_t.item and label_ident = Ast_generic_v1_t.label_ident @@ -1383,6 +1385,26 @@ val id_info_of_string : string -> id_info (** Deserialize JSON data of type {!type:id_info}. *) +val write_import_from_kind : + Buffer.t -> import_from_kind -> unit + (** Output a JSON value of type {!type:import_from_kind}. *) + +val string_of_import_from_kind : + ?len:int -> import_from_kind -> string + (** Serialize a value of type {!type:import_from_kind} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_import_from_kind : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> import_from_kind + (** Input JSON data of type {!type:import_from_kind}. *) + +val import_from_kind_of_string : + string -> import_from_kind + (** Deserialize JSON data of type {!type:import_from_kind}. *) + val write_item : Buffer.t -> item -> unit (** Output a JSON value of type {!type:item}. *) diff --git a/semgrep_output_v1.atd b/semgrep_output_v1.atd index 6ebdfcd..e4dd084 100644 --- a/semgrep_output_v1.atd +++ b/semgrep_output_v1.atd @@ -100,6 +100,8 @@ type uuid = string wrap (* RFC 3339 format *) type datetime = string wrap +type glob = string + (*****************************************************************************) (* Versioning *) (*****************************************************************************) @@ -494,6 +496,7 @@ type match_intermediate_var = { (* both ecosystem and transitivity below have frozen=True so the generated * classes can be hashed and put in sets (see calls to reachable_deps.add() * in semgrep SCA code) + * TODO: use , and do the same for manifest *) type ecosystem @@ -595,6 +598,7 @@ type dependency_child = { * the validity of a finding. No_validator is currently also used when no * validation has yet occurred, which if that becomes confusing we * could adjust that, by adding another state. + * TODO: use *) type validation_state @@ -948,7 +952,7 @@ type cli_output_extra = { type config_error_reason = [ | UnparsableRule -] +] type config_error = { file: fpath; @@ -1141,6 +1145,9 @@ type features = { ~deepsemgrep: bool; ~dependency_query: bool; ~path_to_transitivity: bool; + (* normally we resolve dependencies for changed subprojects only in diff scans. This flag + * causes all subprojects to be resolved in diff scans *) + ~scan_all_deps_in_diff_scan: bool; } type triage_ignored = { @@ -1220,8 +1227,6 @@ type engine_configuration = { ~always_suppress_errors: bool; } -type glob = string - type product_ignored_files = (product * glob list) list (* We omit the usual otherwise we get a * "keys must be strings" error *) @@ -1241,18 +1246,9 @@ type historical_configuration = { (* Sent by the CLI to the POST /api/cli/scans to create a scan. *) type scan_request = { - (* added in 1.43 as options, and mandatory since 1.100.0 (replacing meta) *) project_metadata: project_metadata; scan_metadata: scan_metadata; - - (* added in 1.43 *) ?project_config: ci_config_from_repo option; - - (* deprecated: moved as an option in 1.100.0 and was duplicative of - * information in project_metadata and scan_metadata since 1.43.0 - * old: 'meta: project_metadata;' before 1.43 - *) - ?meta: raw_json option; } (* Collect information about a project from the environment, filesystem, @@ -1262,9 +1258,6 @@ type scan_request = { * clearer (while still being backward compatible) *) type project_metadata = { - (* TODO: deprecate in favor of scan_metadata.cli_version *) - semgrep_version: version; - (* TODO: use enum with *) (* "git" | "github-actions" | "gitlab-ci" | "circleci" * "jenkins" | "bitbucket" | "azure-pipelines" | "buildkite" | "travis-ci" @@ -1594,6 +1587,7 @@ type dependency_parser_error = { (* json names are to maintain backwards compatibility with the python enum it * is replacing + * TODO: use *) type sca_parser_name = [ | Gemfile_lock @@ -2012,6 +2006,7 @@ type lockfile_kind | ConanLock ] +(* TODO: use *) type manifest_kind = diff --git a/semgrep_output_v1.jsonschema b/semgrep_output_v1.jsonschema index ca268ee..49f26a1 100644 --- a/semgrep_output_v1.jsonschema +++ b/semgrep_output_v1.jsonschema @@ -41,6 +41,7 @@ "sha1": { "type": "string" }, "uuid": { "type": "string" }, "datetime": { "type": "string" }, + "glob": { "type": "string" }, "version": { "type": "string" }, "position": { "type": "object", @@ -842,7 +843,8 @@ "autofix": { "type": "boolean" }, "deepsemgrep": { "type": "boolean" }, "dependency_query": { "type": "boolean" }, - "path_to_transitivity": { "type": "boolean" } + "path_to_transitivity": { "type": "boolean" }, + "scan_all_deps_in_diff_scan": { "type": "boolean" } } }, "triage_ignored": { @@ -926,6 +928,7 @@ "deepsemgrep": { "type": "boolean" }, "dependency_query": { "type": "boolean" }, "path_to_transitivity": { "type": "boolean" }, + "scan_all_deps_in_diff_scan": { "type": "boolean" }, "ignored_files": { "type": "array", "items": { "type": "string" } }, "product_ignored_files": { "$ref": "#/definitions/product_ignored_files" @@ -937,7 +940,6 @@ "always_suppress_errors": { "type": "boolean" } } }, - "glob": { "type": "string" }, "product_ignored_files": { "type": "array", "items": { @@ -964,22 +966,20 @@ "properties": { "project_metadata": { "$ref": "#/definitions/project_metadata" }, "scan_metadata": { "$ref": "#/definitions/scan_metadata" }, - "project_config": { "$ref": "#/definitions/ci_config_from_repo" }, - "meta": { "$ref": "#/definitions/raw_json" } + "project_config": { "$ref": "#/definitions/ci_config_from_repo" } } }, "project_metadata": { "type": "object", "required": [ - "semgrep_version", "scan_environment", "repository", "repo_url", - "branch", "commit", "commit_title", "commit_author_email", - "commit_author_name", "commit_author_username", - "commit_author_image_url", "ci_job_url", "on", - "pull_request_author_username", "pull_request_author_image_url", - "pull_request_id", "pull_request_title", "is_full_scan" + "scan_environment", "repository", "repo_url", "branch", "commit", + "commit_title", "commit_author_email", "commit_author_name", + "commit_author_username", "commit_author_image_url", "ci_job_url", + "on", "pull_request_author_username", + "pull_request_author_image_url", "pull_request_id", + "pull_request_title", "is_full_scan" ], "properties": { - "semgrep_version": { "$ref": "#/definitions/version" }, "scan_environment": { "type": "string" }, "repository": { "type": "string" }, "repo_url": { "$ref": "#/definitions/uri" }, @@ -1385,6 +1385,7 @@ "deepsemgrep": { "type": "boolean" }, "dependency_query": { "type": "boolean" }, "path_to_transitivity": { "type": "boolean" }, + "scan_all_deps_in_diff_scan": { "type": "boolean" }, "triage_ignored_syntactic_ids": { "type": "array", "items": { "type": "string" } @@ -1444,7 +1445,8 @@ "autofix": { "type": "boolean" }, "deepsemgrep": { "type": "boolean" }, "dependency_query": { "type": "boolean" }, - "path_to_transitivity": { "type": "boolean" } + "path_to_transitivity": { "type": "boolean" }, + "scan_all_deps_in_diff_scan": { "type": "boolean" } } }, "ci_env": { diff --git a/semgrep_output_v1.proto b/semgrep_output_v1.proto index 3493a97..a28bd2f 100644 --- a/semgrep_output_v1.proto +++ b/semgrep_output_v1.proto @@ -1,6 +1,6 @@ // Generated by jsonschema2protobuf. DO NOT EDIT! // Source file: semgrep_output_v1.jsonschema -// Source file sha256 digest: 752208f118be5d1cfcd76766c034a4e72865b34811d19d444a4b0703479f96fb +// Source file sha256 digest: 33230ba7073d518857d03976371d245036c6cdee44238f2224fd57beb5262890 syntax = "proto3"; @@ -289,6 +289,7 @@ message Features { bool deepsemgrep = 444846865; bool dependency_query = 471197362; bool path_to_transitivity = 52910370; + bool scan_all_deps_in_diff_scan = 261708029; } message TriageIgnored { @@ -320,6 +321,7 @@ message EngineConfiguration { bool deepsemgrep = 444846865; bool dependency_query = 471197362; bool path_to_transitivity = 52910370; + bool scan_all_deps_in_diff_scan = 261708029; repeated string ignored_files = 482076310; repeated google.protobuf.Any product_ignored_files = 298217262; bool generic_slow_rollout = 78139686; @@ -336,11 +338,9 @@ message ScanRequest { ProjectMetadata project_metadata = 24255885; ScanMetadata scan_metadata = 76122041; CiConfigFromRepo project_config = 317758767; - google.protobuf.Any meta = 3004443; } message ProjectMetadata { - string semgrep_version = 118812144; string scan_environment = 288669428; string repository = 439913047; string repo_url = 245057343; @@ -549,6 +549,7 @@ message ScanConfig { bool deepsemgrep = 444846865; bool dependency_query = 471197362; bool path_to_transitivity = 52910370; + bool scan_all_deps_in_diff_scan = 261708029; repeated string triage_ignored_syntactic_ids = 211590151; repeated string triage_ignored_match_based_ids = 327942260; repeated string ignored_files = 482076310; @@ -572,6 +573,7 @@ message CiConfig { bool deepsemgrep = 444846865; bool dependency_query = 471197362; bool path_to_transitivity = 52910370; + bool scan_all_deps_in_diff_scan = 261708029; } message CoreOutput { diff --git a/semgrep_output_v1.py b/semgrep_output_v1.py index a84033b..d50f5cf 100644 --- a/semgrep_output_v1.py +++ b/semgrep_output_v1.py @@ -4912,6 +4912,7 @@ class EngineConfiguration: deepsemgrep: bool = field(default_factory=lambda: False) dependency_query: bool = field(default_factory=lambda: False) path_to_transitivity: bool = field(default_factory=lambda: False) + scan_all_deps_in_diff_scan: bool = field(default_factory=lambda: False) ignored_files: List[str] = field(default_factory=lambda: []) product_ignored_files: Optional[ProductIgnoredFiles] = None generic_slow_rollout: bool = field(default_factory=lambda: False) @@ -4926,6 +4927,7 @@ def from_json(cls, x: Any) -> 'EngineConfiguration': deepsemgrep=_atd_read_bool(x['deepsemgrep']) if 'deepsemgrep' in x else False, dependency_query=_atd_read_bool(x['dependency_query']) if 'dependency_query' in x else False, path_to_transitivity=_atd_read_bool(x['path_to_transitivity']) if 'path_to_transitivity' in x else False, + scan_all_deps_in_diff_scan=_atd_read_bool(x['scan_all_deps_in_diff_scan']) if 'scan_all_deps_in_diff_scan' in x else False, ignored_files=_atd_read_list(_atd_read_string)(x['ignored_files']) if 'ignored_files' in x else [], product_ignored_files=ProductIgnoredFiles.from_json(x['product_ignored_files']) if 'product_ignored_files' in x else None, generic_slow_rollout=_atd_read_bool(x['generic_slow_rollout']) if 'generic_slow_rollout' in x else False, @@ -4941,6 +4943,7 @@ def to_json(self) -> Any: res['deepsemgrep'] = _atd_write_bool(self.deepsemgrep) res['dependency_query'] = _atd_write_bool(self.dependency_query) res['path_to_transitivity'] = _atd_write_bool(self.path_to_transitivity) + res['scan_all_deps_in_diff_scan'] = _atd_write_bool(self.scan_all_deps_in_diff_scan) res['ignored_files'] = _atd_write_list(_atd_write_string)(self.ignored_files) if self.product_ignored_files is not None: res['product_ignored_files'] = (lambda x: x.to_json())(self.product_ignored_files) @@ -5037,7 +5040,6 @@ def to_json_string(self, **kw: Any) -> str: class ProjectMetadata: """Original type: project_metadata = { ... }""" - semgrep_version: Version scan_environment: str repository: str repo_url: Optional[Uri] @@ -5069,7 +5071,6 @@ class ProjectMetadata: def from_json(cls, x: Any) -> 'ProjectMetadata': if isinstance(x, dict): return cls( - semgrep_version=Version.from_json(x['semgrep_version']) if 'semgrep_version' in x else _atd_missing_json_field('ProjectMetadata', 'semgrep_version'), scan_environment=_atd_read_string(x['scan_environment']) if 'scan_environment' in x else _atd_missing_json_field('ProjectMetadata', 'scan_environment'), repository=_atd_read_string(x['repository']) if 'repository' in x else _atd_missing_json_field('ProjectMetadata', 'repository'), repo_url=_atd_read_nullable(Uri.from_json)(x['repo_url']) if 'repo_url' in x else _atd_missing_json_field('ProjectMetadata', 'repo_url'), @@ -5102,7 +5103,6 @@ def from_json(cls, x: Any) -> 'ProjectMetadata': def to_json(self) -> Any: res: Dict[str, Any] = {} - res['semgrep_version'] = (lambda x: x.to_json())(self.semgrep_version) res['scan_environment'] = _atd_write_string(self.scan_environment) res['repository'] = _atd_write_string(self.repository) res['repo_url'] = _atd_write_nullable((lambda x: x.to_json()))(self.repo_url) @@ -5187,7 +5187,6 @@ class ScanRequest: project_metadata: ProjectMetadata scan_metadata: ScanMetadata project_config: Optional[CiConfigFromRepo] = None - meta: Optional[RawJson] = None @classmethod def from_json(cls, x: Any) -> 'ScanRequest': @@ -5196,7 +5195,6 @@ def from_json(cls, x: Any) -> 'ScanRequest': project_metadata=ProjectMetadata.from_json(x['project_metadata']) if 'project_metadata' in x else _atd_missing_json_field('ScanRequest', 'project_metadata'), scan_metadata=ScanMetadata.from_json(x['scan_metadata']) if 'scan_metadata' in x else _atd_missing_json_field('ScanRequest', 'scan_metadata'), project_config=CiConfigFromRepo.from_json(x['project_config']) if 'project_config' in x else None, - meta=RawJson.from_json(x['meta']) if 'meta' in x else None, ) else: _atd_bad_json('ScanRequest', x) @@ -5207,8 +5205,6 @@ def to_json(self) -> Any: res['scan_metadata'] = (lambda x: x.to_json())(self.scan_metadata) if self.project_config is not None: res['project_config'] = (lambda x: x.to_json())(self.project_config) - if self.meta is not None: - res['meta'] = (lambda x: x.to_json())(self.meta) return res @classmethod @@ -5251,6 +5247,7 @@ class CiConfig: deepsemgrep: bool = field(default_factory=lambda: False) dependency_query: bool = field(default_factory=lambda: False) path_to_transitivity: bool = field(default_factory=lambda: False) + scan_all_deps_in_diff_scan: bool = field(default_factory=lambda: False) @classmethod def from_json(cls, x: Any) -> 'CiConfig': @@ -5263,6 +5260,7 @@ def from_json(cls, x: Any) -> 'CiConfig': deepsemgrep=_atd_read_bool(x['deepsemgrep']) if 'deepsemgrep' in x else False, dependency_query=_atd_read_bool(x['dependency_query']) if 'dependency_query' in x else False, path_to_transitivity=_atd_read_bool(x['path_to_transitivity']) if 'path_to_transitivity' in x else False, + scan_all_deps_in_diff_scan=_atd_read_bool(x['scan_all_deps_in_diff_scan']) if 'scan_all_deps_in_diff_scan' in x else False, ) else: _atd_bad_json('CiConfig', x) @@ -5276,6 +5274,7 @@ def to_json(self) -> Any: res['deepsemgrep'] = _atd_write_bool(self.deepsemgrep) res['dependency_query'] = _atd_write_bool(self.dependency_query) res['path_to_transitivity'] = _atd_write_bool(self.path_to_transitivity) + res['scan_all_deps_in_diff_scan'] = _atd_write_bool(self.scan_all_deps_in_diff_scan) return res @classmethod @@ -5426,6 +5425,7 @@ class ScanConfig: deepsemgrep: bool = field(default_factory=lambda: False) dependency_query: bool = field(default_factory=lambda: False) path_to_transitivity: bool = field(default_factory=lambda: False) + scan_all_deps_in_diff_scan: bool = field(default_factory=lambda: False) triage_ignored_syntactic_ids: List[str] = field(default_factory=lambda: []) triage_ignored_match_based_ids: List[str] = field(default_factory=lambda: []) ignored_files: List[str] = field(default_factory=lambda: []) @@ -5445,6 +5445,7 @@ def from_json(cls, x: Any) -> 'ScanConfig': deepsemgrep=_atd_read_bool(x['deepsemgrep']) if 'deepsemgrep' in x else False, dependency_query=_atd_read_bool(x['dependency_query']) if 'dependency_query' in x else False, path_to_transitivity=_atd_read_bool(x['path_to_transitivity']) if 'path_to_transitivity' in x else False, + scan_all_deps_in_diff_scan=_atd_read_bool(x['scan_all_deps_in_diff_scan']) if 'scan_all_deps_in_diff_scan' in x else False, triage_ignored_syntactic_ids=_atd_read_list(_atd_read_string)(x['triage_ignored_syntactic_ids']) if 'triage_ignored_syntactic_ids' in x else [], triage_ignored_match_based_ids=_atd_read_list(_atd_read_string)(x['triage_ignored_match_based_ids']) if 'triage_ignored_match_based_ids' in x else [], ignored_files=_atd_read_list(_atd_read_string)(x['ignored_files']) if 'ignored_files' in x else [], @@ -5465,6 +5466,7 @@ def to_json(self) -> Any: res['deepsemgrep'] = _atd_write_bool(self.deepsemgrep) res['dependency_query'] = _atd_write_bool(self.dependency_query) res['path_to_transitivity'] = _atd_write_bool(self.path_to_transitivity) + res['scan_all_deps_in_diff_scan'] = _atd_write_bool(self.scan_all_deps_in_diff_scan) res['triage_ignored_syntactic_ids'] = _atd_write_list(_atd_write_string)(self.triage_ignored_syntactic_ids) res['triage_ignored_match_based_ids'] = _atd_write_list(_atd_write_string)(self.triage_ignored_match_based_ids) res['ignored_files'] = _atd_write_list(_atd_write_string)(self.ignored_files) @@ -8745,6 +8747,7 @@ class Features: deepsemgrep: bool = field(default_factory=lambda: False) dependency_query: bool = field(default_factory=lambda: False) path_to_transitivity: bool = field(default_factory=lambda: False) + scan_all_deps_in_diff_scan: bool = field(default_factory=lambda: False) @classmethod def from_json(cls, x: Any) -> 'Features': @@ -8754,6 +8757,7 @@ def from_json(cls, x: Any) -> 'Features': deepsemgrep=_atd_read_bool(x['deepsemgrep']) if 'deepsemgrep' in x else False, dependency_query=_atd_read_bool(x['dependency_query']) if 'dependency_query' in x else False, path_to_transitivity=_atd_read_bool(x['path_to_transitivity']) if 'path_to_transitivity' in x else False, + scan_all_deps_in_diff_scan=_atd_read_bool(x['scan_all_deps_in_diff_scan']) if 'scan_all_deps_in_diff_scan' in x else False, ) else: _atd_bad_json('Features', x) @@ -8764,6 +8768,7 @@ def to_json(self) -> Any: res['deepsemgrep'] = _atd_write_bool(self.deepsemgrep) res['dependency_query'] = _atd_write_bool(self.dependency_query) res['path_to_transitivity'] = _atd_write_bool(self.path_to_transitivity) + res['scan_all_deps_in_diff_scan'] = _atd_write_bool(self.scan_all_deps_in_diff_scan) return res @classmethod diff --git a/semgrep_output_v1.ts b/semgrep_output_v1.ts index 10fd99f..0d6679b 100644 --- a/semgrep_output_v1.ts +++ b/semgrep_output_v1.ts @@ -26,6 +26,8 @@ export type Uuid = string export type Datetime = string +export type Glob = string + export type Version = string export type Position = { @@ -460,6 +462,7 @@ export type Features = { deepsemgrep: boolean; dependency_query: boolean; path_to_transitivity: boolean; + scan_all_deps_in_diff_scan: boolean; } export type TriageIgnored = { @@ -496,6 +499,7 @@ export type EngineConfiguration = { deepsemgrep: boolean; dependency_query: boolean; path_to_transitivity: boolean; + scan_all_deps_in_diff_scan: boolean; ignored_files: string[]; product_ignored_files?: ProductIgnoredFiles; generic_slow_rollout: boolean; @@ -503,8 +507,6 @@ export type EngineConfiguration = { always_suppress_errors: boolean; } -export type Glob = string - export type ProductIgnoredFiles = Map export type HistoricalConfiguration = { @@ -516,11 +518,9 @@ export type ScanRequest = { project_metadata: ProjectMetadata; scan_metadata: ScanMetadata; project_config?: CiConfigFromRepo; - meta?: RawJson; } export type ProjectMetadata = { - semgrep_version: Version; scan_environment: string; repository: string; repo_url: (Uri | null); @@ -766,6 +766,7 @@ export type ScanConfig = { deepsemgrep: boolean; dependency_query: boolean; path_to_transitivity: boolean; + scan_all_deps_in_diff_scan: boolean; triage_ignored_syntactic_ids: string[]; triage_ignored_match_based_ids: string[]; ignored_files: string[]; @@ -789,6 +790,7 @@ export type CiConfig = { deepsemgrep: boolean; dependency_query: boolean; path_to_transitivity: boolean; + scan_all_deps_in_diff_scan: boolean; } export type CiEnv = Map @@ -1053,6 +1055,14 @@ export function readDatetime(x: any, context: any = x): Datetime { return _atd_read_string(x, context); } +export function writeGlob(x: Glob, context: any = x): any { + return _atd_write_string(x, context); +} + +export function readGlob(x: any, context: any = x): Glob { + return _atd_read_string(x, context); +} + export function writeVersion(x: Version, context: any = x): any { return _atd_write_string(x, context); } @@ -2506,6 +2516,7 @@ export function writeFeatures(x: Features, context: any = x): any { 'deepsemgrep': _atd_write_field_with_default(_atd_write_bool, false, x.deepsemgrep, x), 'dependency_query': _atd_write_field_with_default(_atd_write_bool, false, x.dependency_query, x), 'path_to_transitivity': _atd_write_field_with_default(_atd_write_bool, false, x.path_to_transitivity, x), + 'scan_all_deps_in_diff_scan': _atd_write_field_with_default(_atd_write_bool, false, x.scan_all_deps_in_diff_scan, x), }; } @@ -2515,6 +2526,7 @@ export function readFeatures(x: any, context: any = x): Features { deepsemgrep: _atd_read_field_with_default(_atd_read_bool, false, x['deepsemgrep'], x), dependency_query: _atd_read_field_with_default(_atd_read_bool, false, x['dependency_query'], x), path_to_transitivity: _atd_read_field_with_default(_atd_read_bool, false, x['path_to_transitivity'], x), + scan_all_deps_in_diff_scan: _atd_read_field_with_default(_atd_read_bool, false, x['scan_all_deps_in_diff_scan'], x), }; } @@ -2614,6 +2626,7 @@ export function writeEngineConfiguration(x: EngineConfiguration, context: any = 'deepsemgrep': _atd_write_field_with_default(_atd_write_bool, false, x.deepsemgrep, x), 'dependency_query': _atd_write_field_with_default(_atd_write_bool, false, x.dependency_query, x), 'path_to_transitivity': _atd_write_field_with_default(_atd_write_bool, false, x.path_to_transitivity, x), + 'scan_all_deps_in_diff_scan': _atd_write_field_with_default(_atd_write_bool, false, x.scan_all_deps_in_diff_scan, x), 'ignored_files': _atd_write_field_with_default(_atd_write_array(_atd_write_string), [], x.ignored_files, x), 'product_ignored_files': _atd_write_optional_field(writeProductIgnoredFiles, x.product_ignored_files, x), 'generic_slow_rollout': _atd_write_field_with_default(_atd_write_bool, false, x.generic_slow_rollout, x), @@ -2628,6 +2641,7 @@ export function readEngineConfiguration(x: any, context: any = x): EngineConfigu deepsemgrep: _atd_read_field_with_default(_atd_read_bool, false, x['deepsemgrep'], x), dependency_query: _atd_read_field_with_default(_atd_read_bool, false, x['dependency_query'], x), path_to_transitivity: _atd_read_field_with_default(_atd_read_bool, false, x['path_to_transitivity'], x), + scan_all_deps_in_diff_scan: _atd_read_field_with_default(_atd_read_bool, false, x['scan_all_deps_in_diff_scan'], x), ignored_files: _atd_read_field_with_default(_atd_read_array(_atd_read_string), [], x['ignored_files'], x), product_ignored_files: _atd_read_optional_field(readProductIgnoredFiles, x['product_ignored_files'], x), generic_slow_rollout: _atd_read_field_with_default(_atd_read_bool, false, x['generic_slow_rollout'], x), @@ -2636,14 +2650,6 @@ export function readEngineConfiguration(x: any, context: any = x): EngineConfigu }; } -export function writeGlob(x: Glob, context: any = x): any { - return _atd_write_string(x, context); -} - -export function readGlob(x: any, context: any = x): Glob { - return _atd_read_string(x, context); -} - export function writeProductIgnoredFiles(x: ProductIgnoredFiles, context: any = x): any { return _atd_write_assoc_map_to_array(writeProduct, _atd_write_array(writeGlob))(x, context); } @@ -2671,7 +2677,6 @@ export function writeScanRequest(x: ScanRequest, context: any = x): any { 'project_metadata': _atd_write_required_field('ScanRequest', 'project_metadata', writeProjectMetadata, x.project_metadata, x), 'scan_metadata': _atd_write_required_field('ScanRequest', 'scan_metadata', writeScanMetadata, x.scan_metadata, x), 'project_config': _atd_write_optional_field(writeCiConfigFromRepo, x.project_config, x), - 'meta': _atd_write_optional_field(writeRawJson, x.meta, x), }; } @@ -2680,13 +2685,11 @@ export function readScanRequest(x: any, context: any = x): ScanRequest { project_metadata: _atd_read_required_field('ScanRequest', 'project_metadata', readProjectMetadata, x['project_metadata'], x), scan_metadata: _atd_read_required_field('ScanRequest', 'scan_metadata', readScanMetadata, x['scan_metadata'], x), project_config: _atd_read_optional_field(readCiConfigFromRepo, x['project_config'], x), - meta: _atd_read_optional_field(readRawJson, x['meta'], x), }; } export function writeProjectMetadata(x: ProjectMetadata, context: any = x): any { return { - 'semgrep_version': _atd_write_required_field('ProjectMetadata', 'semgrep_version', writeVersion, x.semgrep_version, x), 'scan_environment': _atd_write_required_field('ProjectMetadata', 'scan_environment', _atd_write_string, x.scan_environment, x), 'repository': _atd_write_required_field('ProjectMetadata', 'repository', _atd_write_string, x.repository, x), 'repo_url': _atd_write_required_field('ProjectMetadata', 'repo_url', _atd_write_nullable(writeUri), x.repo_url, x), @@ -2718,7 +2721,6 @@ export function writeProjectMetadata(x: ProjectMetadata, context: any = x): any export function readProjectMetadata(x: any, context: any = x): ProjectMetadata { return { - semgrep_version: _atd_read_required_field('ProjectMetadata', 'semgrep_version', readVersion, x['semgrep_version'], x), scan_environment: _atd_read_required_field('ProjectMetadata', 'scan_environment', _atd_read_string, x['scan_environment'], x), repository: _atd_read_required_field('ProjectMetadata', 'repository', _atd_read_string, x['repository'], x), repo_url: _atd_read_required_field('ProjectMetadata', 'repo_url', _atd_read_nullable(readUri), x['repo_url'], x), @@ -3352,6 +3354,7 @@ export function writeScanConfig(x: ScanConfig, context: any = x): any { 'deepsemgrep': _atd_write_field_with_default(_atd_write_bool, false, x.deepsemgrep, x), 'dependency_query': _atd_write_field_with_default(_atd_write_bool, false, x.dependency_query, x), 'path_to_transitivity': _atd_write_field_with_default(_atd_write_bool, false, x.path_to_transitivity, x), + 'scan_all_deps_in_diff_scan': _atd_write_field_with_default(_atd_write_bool, false, x.scan_all_deps_in_diff_scan, x), 'triage_ignored_syntactic_ids': _atd_write_field_with_default(_atd_write_array(_atd_write_string), [], x.triage_ignored_syntactic_ids, x), 'triage_ignored_match_based_ids': _atd_write_field_with_default(_atd_write_array(_atd_write_string), [], x.triage_ignored_match_based_ids, x), 'ignored_files': _atd_write_field_with_default(_atd_write_array(_atd_write_string), [], x.ignored_files, x), @@ -3371,6 +3374,7 @@ export function readScanConfig(x: any, context: any = x): ScanConfig { deepsemgrep: _atd_read_field_with_default(_atd_read_bool, false, x['deepsemgrep'], x), dependency_query: _atd_read_field_with_default(_atd_read_bool, false, x['dependency_query'], x), path_to_transitivity: _atd_read_field_with_default(_atd_read_bool, false, x['path_to_transitivity'], x), + scan_all_deps_in_diff_scan: _atd_read_field_with_default(_atd_read_bool, false, x['scan_all_deps_in_diff_scan'], x), triage_ignored_syntactic_ids: _atd_read_field_with_default(_atd_read_array(_atd_read_string), [], x['triage_ignored_syntactic_ids'], x), triage_ignored_match_based_ids: _atd_read_field_with_default(_atd_read_array(_atd_read_string), [], x['triage_ignored_match_based_ids'], x), ignored_files: _atd_read_field_with_default(_atd_read_array(_atd_read_string), [], x['ignored_files'], x), @@ -3407,6 +3411,7 @@ export function writeCiConfig(x: CiConfig, context: any = x): any { 'deepsemgrep': _atd_write_field_with_default(_atd_write_bool, false, x.deepsemgrep, x), 'dependency_query': _atd_write_field_with_default(_atd_write_bool, false, x.dependency_query, x), 'path_to_transitivity': _atd_write_field_with_default(_atd_write_bool, false, x.path_to_transitivity, x), + 'scan_all_deps_in_diff_scan': _atd_write_field_with_default(_atd_write_bool, false, x.scan_all_deps_in_diff_scan, x), }; } @@ -3419,6 +3424,7 @@ export function readCiConfig(x: any, context: any = x): CiConfig { deepsemgrep: _atd_read_field_with_default(_atd_read_bool, false, x['deepsemgrep'], x), dependency_query: _atd_read_field_with_default(_atd_read_bool, false, x['dependency_query'], x), path_to_transitivity: _atd_read_field_with_default(_atd_read_bool, false, x['path_to_transitivity'], x), + scan_all_deps_in_diff_scan: _atd_read_field_with_default(_atd_read_bool, false, x['scan_all_deps_in_diff_scan'], x), }; } diff --git a/semgrep_output_v1_j.ml b/semgrep_output_v1_j.ml index e70c9eb..13cc6e8 100644 --- a/semgrep_output_v1_j.ml +++ b/semgrep_output_v1_j.ml @@ -238,7 +238,9 @@ type rule_result = Semgrep_output_v1_t.rule_result = { type fixtest_result = Semgrep_output_v1_t.fixtest_result = { passed: bool } -type config_error_reason = Semgrep_output_v1_t.config_error_reason +type config_error_reason = Semgrep_output_v1_t.config_error_reason = + UnparsableRule + type config_error = Semgrep_output_v1_t.config_error = { file: fpath; @@ -386,6 +388,7 @@ type engine_configuration = Semgrep_output_v1_t.engine_configuration = { deepsemgrep: bool; dependency_query: bool; path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool; ignored_files: string list; product_ignored_files: product_ignored_files option; generic_slow_rollout: bool; @@ -408,7 +411,6 @@ type scan_metadata = Semgrep_output_v1_t.scan_metadata = { } type project_metadata = Semgrep_output_v1_t.project_metadata = { - semgrep_version: version; scan_environment: string; repository: string; repo_url: uri option; @@ -445,8 +447,7 @@ type ci_config_from_repo = Semgrep_output_v1_t.ci_config_from_repo = { type scan_request = Semgrep_output_v1_t.scan_request = { project_metadata: project_metadata; scan_metadata: scan_metadata; - project_config: ci_config_from_repo option; - meta: raw_json option + project_config: ci_config_from_repo option } type ci_env = Semgrep_output_v1_t.ci_env @@ -458,7 +459,8 @@ type ci_config = Semgrep_output_v1_t.ci_config = { autofix: bool; deepsemgrep: bool; dependency_query: bool; - path_to_transitivity: bool + path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool } type action = Semgrep_output_v1_t.action @@ -479,6 +481,7 @@ type scan_config = Semgrep_output_v1_t.scan_config = { deepsemgrep: bool; dependency_query: bool; path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool; triage_ignored_syntactic_ids: string list; triage_ignored_match_based_ids: string list; ignored_files: string list; @@ -793,7 +796,8 @@ type features = Semgrep_output_v1_t.features = { autofix: bool; deepsemgrep: bool; dependency_query: bool; - path_to_transitivity: bool + path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool } type diff_file = Semgrep_output_v1_t.diff_file = { @@ -9454,10 +9458,10 @@ let read_fixtest_result = ( ) let fixtest_result_of_string s = read_fixtest_result (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write_config_error_reason = ( - fun ob x -> +let write_config_error_reason : _ -> config_error_reason -> _ = ( + fun ob (x : config_error_reason) -> match x with - | `UnparsableRule -> Buffer.add_string ob "\"unparsable_rule\"" + | UnparsableRule -> Buffer.add_string ob "\"unparsable_rule\"" ) let string_of_config_error_reason ?(len = 1024) x = let ob = Buffer.create len in @@ -9472,14 +9476,14 @@ let read_config_error_reason = ( | "unparsable_rule" -> Yojson.Safe.read_space p lb; Yojson.Safe.read_gt p lb; - `UnparsableRule + (UnparsableRule : config_error_reason) | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x ) | `Double_quote -> ( match Yojson.Safe.finish_string p lb with | "unparsable_rule" -> - `UnparsableRule + (UnparsableRule : config_error_reason) | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x ) @@ -14108,6 +14112,15 @@ let write_engine_configuration : _ -> engine_configuration -> _ = ( ob x.path_to_transitivity; if !is_first then is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"scan_all_deps_in_diff_scan\":"; + ( + Yojson.Safe.write_bool + ) + ob x.scan_all_deps_in_diff_scan; + if !is_first then + is_first := false else Buffer.add_char ob ','; Buffer.add_string ob "\"ignored_files\":"; @@ -14169,6 +14182,7 @@ let read_engine_configuration = ( let field_deepsemgrep = ref (false) in let field_dependency_query = ref (false) in let field_path_to_transitivity = ref (false) in + let field_scan_all_deps_in_diff_scan = ref (false) in let field_ignored_files = ref ([]) in let field_product_ignored_files = ref (None) in let field_generic_slow_rollout = ref (false) in @@ -14201,7 +14215,7 @@ let read_engine_configuration = ( ) | 13 -> ( if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'g' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( - 4 + 5 ) else ( -1 @@ -14217,7 +14231,7 @@ let read_engine_configuration = ( ) | 17 -> ( if String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'f' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'g' then ( - 7 + 8 ) else ( -1 @@ -14227,7 +14241,7 @@ let read_engine_configuration = ( match String.unsafe_get s pos with | 'g' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'w' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 't' then ( - 6 + 7 ) else ( -1 @@ -14247,7 +14261,7 @@ let read_engine_configuration = ( ) | 21 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'd' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'f' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' && String.unsafe_get s (pos+19) = 'e' && String.unsafe_get s (pos+20) = 's' then ( - 5 + 6 ) else ( -1 @@ -14255,7 +14269,15 @@ let read_engine_configuration = ( ) | 22 -> ( if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'l' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 's' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = 'o' && String.unsafe_get s (pos+20) = 'r' && String.unsafe_get s (pos+21) = 's' then ( - 8 + 9 + ) + else ( + -1 + ) + ) + | 26 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 4 ) else ( -1 @@ -14302,6 +14324,14 @@ let read_engine_configuration = ( ); ) | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 5 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ignored_files := ( ( @@ -14309,7 +14339,7 @@ let read_engine_configuration = ( ) p lb ); ) - | 5 -> + | 6 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_product_ignored_files := ( Some ( @@ -14319,7 +14349,7 @@ let read_engine_configuration = ( ) ); ) - | 6 -> + | 7 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_generic_slow_rollout := ( ( @@ -14327,7 +14357,7 @@ let read_engine_configuration = ( ) p lb ); ) - | 7 -> + | 8 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_historical_config := ( Some ( @@ -14337,7 +14367,7 @@ let read_engine_configuration = ( ) ); ) - | 8 -> + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_always_suppress_errors := ( ( @@ -14376,7 +14406,7 @@ let read_engine_configuration = ( ) | 13 -> ( if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'g' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( - 4 + 5 ) else ( -1 @@ -14392,7 +14422,7 @@ let read_engine_configuration = ( ) | 17 -> ( if String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'f' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'g' then ( - 7 + 8 ) else ( -1 @@ -14402,7 +14432,7 @@ let read_engine_configuration = ( match String.unsafe_get s pos with | 'g' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'w' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 't' then ( - 6 + 7 ) else ( -1 @@ -14422,7 +14452,7 @@ let read_engine_configuration = ( ) | 21 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'd' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'f' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' && String.unsafe_get s (pos+19) = 'e' && String.unsafe_get s (pos+20) = 's' then ( - 5 + 6 ) else ( -1 @@ -14430,7 +14460,15 @@ let read_engine_configuration = ( ) | 22 -> ( if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'l' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 's' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = 'o' && String.unsafe_get s (pos+20) = 'r' && String.unsafe_get s (pos+21) = 's' then ( - 8 + 9 + ) + else ( + -1 + ) + ) + | 26 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 4 ) else ( -1 @@ -14477,6 +14515,14 @@ let read_engine_configuration = ( ); ) | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 5 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ignored_files := ( ( @@ -14484,7 +14530,7 @@ let read_engine_configuration = ( ) p lb ); ) - | 5 -> + | 6 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_product_ignored_files := ( Some ( @@ -14494,7 +14540,7 @@ let read_engine_configuration = ( ) ); ) - | 6 -> + | 7 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_generic_slow_rollout := ( ( @@ -14502,7 +14548,7 @@ let read_engine_configuration = ( ) p lb ); ) - | 7 -> + | 8 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_historical_config := ( Some ( @@ -14512,7 +14558,7 @@ let read_engine_configuration = ( ) ); ) - | 8 -> + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_always_suppress_errors := ( ( @@ -14533,6 +14579,7 @@ let read_engine_configuration = ( deepsemgrep = !field_deepsemgrep; dependency_query = !field_dependency_query; path_to_transitivity = !field_path_to_transitivity; + scan_all_deps_in_diff_scan = !field_scan_all_deps_in_diff_scan; ignored_files = !field_ignored_files; product_ignored_files = !field_product_ignored_files; generic_slow_rollout = !field_generic_slow_rollout; @@ -15215,15 +15262,6 @@ let write_project_metadata : _ -> project_metadata -> _ = ( fun ob (x : project_metadata) -> Buffer.add_char ob '{'; let is_first = ref true in - if !is_first then - is_first := false - else - Buffer.add_char ob ','; - Buffer.add_string ob "\"semgrep_version\":"; - ( - write_version - ) - ob x.semgrep_version; if !is_first then is_first := false else @@ -15486,7 +15524,6 @@ let read_project_metadata = ( fun p lb -> Yojson.Safe.read_space p lb; Yojson.Safe.read_lcurl p lb; - let field_semgrep_version = ref (None) in let field_scan_environment = ref (None) in let field_repository = ref (None) in let field_repo_url = ref (None) in @@ -15524,7 +15561,7 @@ let read_project_metadata = ( match len with | 2 -> ( if String.unsafe_get s pos = 'o' && String.unsafe_get s (pos+1) = 'n' then ( - 16 + 15 ) else ( -1 @@ -15534,7 +15571,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'b' -> ( if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'h' then ( - 7 + 6 ) else ( -1 @@ -15542,7 +15579,7 @@ let read_project_metadata = ( ) | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' then ( - 8 + 7 ) else ( -1 @@ -15550,7 +15587,7 @@ let read_project_metadata = ( ) | 'o' -> ( if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = '_' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'd' then ( - 5 + 4 ) else ( -1 @@ -15562,7 +15599,7 @@ let read_project_metadata = ( ) | 7 -> ( if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'd' then ( - 4 + 3 ) else ( -1 @@ -15572,7 +15609,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'b' -> ( if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'h' && String.unsafe_get s (pos+7) = 'a' then ( - 21 + 20 ) else ( -1 @@ -15580,7 +15617,7 @@ let read_project_metadata = ( ) | 'r' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'l' then ( - 3 + 2 ) else ( -1 @@ -15592,7 +15629,7 @@ let read_project_metadata = ( ) | 9 -> ( if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = '_' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'a' then ( - 22 + 21 ) else ( -1 @@ -15602,7 +15639,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 'j' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'b' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'l' then ( - 15 + 14 ) else ( -1 @@ -15610,7 +15647,7 @@ let read_project_metadata = ( ) | 'r' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'y' then ( - 2 + 1 ) else ( -1 @@ -15622,7 +15659,7 @@ let read_project_metadata = ( ) | 11 -> ( if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'n' then ( - 24 + 23 ) else ( -1 @@ -15632,7 +15669,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' then ( - 9 + 8 ) else ( -1 @@ -15643,7 +15680,7 @@ let read_project_metadata = ( match String.unsafe_get s (pos+3) with | 'c' -> ( if String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' then ( - 25 + 24 ) else ( -1 @@ -15651,7 +15688,7 @@ let read_project_metadata = ( ) | 'f' -> ( if String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' then ( - 23 + 22 ) else ( -1 @@ -15673,7 +15710,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'i' -> ( if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'n' then ( - 26 + 25 ) else ( -1 @@ -15681,15 +15718,7 @@ let read_project_metadata = ( ) | 'p' -> ( if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'd' then ( - 19 - ) - else ( - -1 - ) - ) - | 's' -> ( - if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'v' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( - 0 + 18 ) else ( -1 @@ -15703,7 +15732,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'm' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'm' && String.unsafe_get s (pos+15) = 'p' then ( - 10 + 9 ) else ( -1 @@ -15711,7 +15740,7 @@ let read_project_metadata = ( ) | 's' -> ( if String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'v' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 't' then ( - 1 + 0 ) else ( -1 @@ -15723,7 +15752,7 @@ let read_project_metadata = ( ) | 17 -> ( if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'p' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'a' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'e' then ( - 6 + 5 ) else ( -1 @@ -15733,7 +15762,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' then ( - 12 + 11 ) else ( -1 @@ -15741,7 +15770,7 @@ let read_project_metadata = ( ) | 'p' -> ( if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'e' then ( - 20 + 19 ) else ( -1 @@ -15753,7 +15782,7 @@ let read_project_metadata = ( ) | 19 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' then ( - 11 + 10 ) else ( -1 @@ -15761,7 +15790,7 @@ let read_project_metadata = ( ) | 22 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'n' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'm' && String.unsafe_get s (pos+21) = 'e' then ( - 13 + 12 ) else ( -1 @@ -15769,7 +15798,7 @@ let read_project_metadata = ( ) | 23 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'g' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'u' && String.unsafe_get s (pos+21) = 'r' && String.unsafe_get s (pos+22) = 'l' then ( - 14 + 13 ) else ( -1 @@ -15777,7 +15806,7 @@ let read_project_metadata = ( ) | 28 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'h' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'u' && String.unsafe_get s (pos+21) = 's' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 'r' && String.unsafe_get s (pos+24) = 'n' && String.unsafe_get s (pos+25) = 'a' && String.unsafe_get s (pos+26) = 'm' && String.unsafe_get s (pos+27) = 'e' then ( - 17 + 16 ) else ( -1 @@ -15785,7 +15814,7 @@ let read_project_metadata = ( ) | 29 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'h' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'i' && String.unsafe_get s (pos+21) = 'm' && String.unsafe_get s (pos+22) = 'a' && String.unsafe_get s (pos+23) = 'g' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = '_' && String.unsafe_get s (pos+26) = 'u' && String.unsafe_get s (pos+27) = 'r' && String.unsafe_get s (pos+28) = 'l' then ( - 18 + 17 ) else ( -1 @@ -15800,14 +15829,6 @@ let read_project_metadata = ( ( match i with | 0 -> - field_semgrep_version := ( - Some ( - ( - read_version - ) p lb - ) - ); - | 1 -> field_scan_environment := ( Some ( ( @@ -15815,7 +15836,7 @@ let read_project_metadata = ( ) p lb ) ); - | 2 -> + | 1 -> field_repository := ( Some ( ( @@ -15823,7 +15844,7 @@ let read_project_metadata = ( ) p lb ) ); - | 3 -> + | 2 -> field_repo_url := ( Some ( ( @@ -15831,7 +15852,7 @@ let read_project_metadata = ( ) p lb ) ); - | 4 -> + | 3 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_repo_id := ( Some ( @@ -15841,7 +15862,7 @@ let read_project_metadata = ( ) ); ) - | 5 -> + | 4 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_org_id := ( Some ( @@ -15851,7 +15872,7 @@ let read_project_metadata = ( ) ); ) - | 6 -> + | 5 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_repo_display_name := ( Some ( @@ -15861,7 +15882,7 @@ let read_project_metadata = ( ) ); ) - | 7 -> + | 6 -> field_branch := ( Some ( ( @@ -15869,7 +15890,7 @@ let read_project_metadata = ( ) p lb ) ); - | 8 -> + | 7 -> field_commit := ( Some ( ( @@ -15877,7 +15898,7 @@ let read_project_metadata = ( ) p lb ) ); - | 9 -> + | 8 -> field_commit_title := ( Some ( ( @@ -15885,7 +15906,7 @@ let read_project_metadata = ( ) p lb ) ); - | 10 -> + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_commit_timestamp := ( Some ( @@ -15895,7 +15916,7 @@ let read_project_metadata = ( ) ); ) - | 11 -> + | 10 -> field_commit_author_email := ( Some ( ( @@ -15903,7 +15924,7 @@ let read_project_metadata = ( ) p lb ) ); - | 12 -> + | 11 -> field_commit_author_name := ( Some ( ( @@ -15911,7 +15932,7 @@ let read_project_metadata = ( ) p lb ) ); - | 13 -> + | 12 -> field_commit_author_username := ( Some ( ( @@ -15919,7 +15940,7 @@ let read_project_metadata = ( ) p lb ) ); - | 14 -> + | 13 -> field_commit_author_image_url := ( Some ( ( @@ -15927,7 +15948,7 @@ let read_project_metadata = ( ) p lb ) ); - | 15 -> + | 14 -> field_ci_job_url := ( Some ( ( @@ -15935,7 +15956,7 @@ let read_project_metadata = ( ) p lb ) ); - | 16 -> + | 15 -> field_on := ( Some ( ( @@ -15943,7 +15964,7 @@ let read_project_metadata = ( ) p lb ) ); - | 17 -> + | 16 -> field_pull_request_author_username := ( Some ( ( @@ -15951,7 +15972,7 @@ let read_project_metadata = ( ) p lb ) ); - | 18 -> + | 17 -> field_pull_request_author_image_url := ( Some ( ( @@ -15959,7 +15980,7 @@ let read_project_metadata = ( ) p lb ) ); - | 19 -> + | 18 -> field_pull_request_id := ( Some ( ( @@ -15967,7 +15988,7 @@ let read_project_metadata = ( ) p lb ) ); - | 20 -> + | 19 -> field_pull_request_title := ( Some ( ( @@ -15975,7 +15996,7 @@ let read_project_metadata = ( ) p lb ) ); - | 21 -> + | 20 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_base_sha := ( Some ( @@ -15985,7 +16006,7 @@ let read_project_metadata = ( ) ); ) - | 22 -> + | 21 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_start_sha := ( Some ( @@ -15995,7 +16016,7 @@ let read_project_metadata = ( ) ); ) - | 23 -> + | 22 -> field_is_full_scan := ( Some ( ( @@ -16003,7 +16024,7 @@ let read_project_metadata = ( ) p lb ) ); - | 24 -> + | 23 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_sca_scan := ( Some ( @@ -16013,7 +16034,7 @@ let read_project_metadata = ( ) ); ) - | 25 -> + | 24 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_code_scan := ( Some ( @@ -16023,7 +16044,7 @@ let read_project_metadata = ( ) ); ) - | 26 -> + | 25 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_secrets_scan := ( Some ( @@ -16048,7 +16069,7 @@ let read_project_metadata = ( match len with | 2 -> ( if String.unsafe_get s pos = 'o' && String.unsafe_get s (pos+1) = 'n' then ( - 16 + 15 ) else ( -1 @@ -16058,7 +16079,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'b' -> ( if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'h' then ( - 7 + 6 ) else ( -1 @@ -16066,7 +16087,7 @@ let read_project_metadata = ( ) | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' then ( - 8 + 7 ) else ( -1 @@ -16074,7 +16095,7 @@ let read_project_metadata = ( ) | 'o' -> ( if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = '_' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'd' then ( - 5 + 4 ) else ( -1 @@ -16086,7 +16107,7 @@ let read_project_metadata = ( ) | 7 -> ( if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'd' then ( - 4 + 3 ) else ( -1 @@ -16096,7 +16117,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'b' -> ( if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'h' && String.unsafe_get s (pos+7) = 'a' then ( - 21 + 20 ) else ( -1 @@ -16104,7 +16125,7 @@ let read_project_metadata = ( ) | 'r' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'l' then ( - 3 + 2 ) else ( -1 @@ -16116,7 +16137,7 @@ let read_project_metadata = ( ) | 9 -> ( if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = '_' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'a' then ( - 22 + 21 ) else ( -1 @@ -16126,7 +16147,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 'j' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'b' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'l' then ( - 15 + 14 ) else ( -1 @@ -16134,7 +16155,7 @@ let read_project_metadata = ( ) | 'r' -> ( if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'y' then ( - 2 + 1 ) else ( -1 @@ -16146,7 +16167,7 @@ let read_project_metadata = ( ) | 11 -> ( if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'n' then ( - 24 + 23 ) else ( -1 @@ -16156,7 +16177,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' then ( - 9 + 8 ) else ( -1 @@ -16167,7 +16188,7 @@ let read_project_metadata = ( match String.unsafe_get s (pos+3) with | 'c' -> ( if String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' then ( - 25 + 24 ) else ( -1 @@ -16175,7 +16196,7 @@ let read_project_metadata = ( ) | 'f' -> ( if String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' then ( - 23 + 22 ) else ( -1 @@ -16197,7 +16218,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'i' -> ( if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'n' then ( - 26 + 25 ) else ( -1 @@ -16205,15 +16226,7 @@ let read_project_metadata = ( ) | 'p' -> ( if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'd' then ( - 19 - ) - else ( - -1 - ) - ) - | 's' -> ( - if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'v' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( - 0 + 18 ) else ( -1 @@ -16227,7 +16240,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'm' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'm' && String.unsafe_get s (pos+15) = 'p' then ( - 10 + 9 ) else ( -1 @@ -16235,7 +16248,7 @@ let read_project_metadata = ( ) | 's' -> ( if String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'v' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 't' then ( - 1 + 0 ) else ( -1 @@ -16247,7 +16260,7 @@ let read_project_metadata = ( ) | 17 -> ( if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'p' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'a' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'e' then ( - 6 + 5 ) else ( -1 @@ -16257,7 +16270,7 @@ let read_project_metadata = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' then ( - 12 + 11 ) else ( -1 @@ -16265,7 +16278,7 @@ let read_project_metadata = ( ) | 'p' -> ( if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'e' then ( - 20 + 19 ) else ( -1 @@ -16277,7 +16290,7 @@ let read_project_metadata = ( ) | 19 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' then ( - 11 + 10 ) else ( -1 @@ -16285,7 +16298,7 @@ let read_project_metadata = ( ) | 22 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'n' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'm' && String.unsafe_get s (pos+21) = 'e' then ( - 13 + 12 ) else ( -1 @@ -16293,7 +16306,7 @@ let read_project_metadata = ( ) | 23 -> ( if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'g' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'u' && String.unsafe_get s (pos+21) = 'r' && String.unsafe_get s (pos+22) = 'l' then ( - 14 + 13 ) else ( -1 @@ -16301,7 +16314,7 @@ let read_project_metadata = ( ) | 28 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'h' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'u' && String.unsafe_get s (pos+21) = 's' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 'r' && String.unsafe_get s (pos+24) = 'n' && String.unsafe_get s (pos+25) = 'a' && String.unsafe_get s (pos+26) = 'm' && String.unsafe_get s (pos+27) = 'e' then ( - 17 + 16 ) else ( -1 @@ -16309,7 +16322,7 @@ let read_project_metadata = ( ) | 29 -> ( if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'q' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = '_' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'h' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'r' && String.unsafe_get s (pos+19) = '_' && String.unsafe_get s (pos+20) = 'i' && String.unsafe_get s (pos+21) = 'm' && String.unsafe_get s (pos+22) = 'a' && String.unsafe_get s (pos+23) = 'g' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = '_' && String.unsafe_get s (pos+26) = 'u' && String.unsafe_get s (pos+27) = 'r' && String.unsafe_get s (pos+28) = 'l' then ( - 18 + 17 ) else ( -1 @@ -16324,14 +16337,6 @@ let read_project_metadata = ( ( match i with | 0 -> - field_semgrep_version := ( - Some ( - ( - read_version - ) p lb - ) - ); - | 1 -> field_scan_environment := ( Some ( ( @@ -16339,7 +16344,7 @@ let read_project_metadata = ( ) p lb ) ); - | 2 -> + | 1 -> field_repository := ( Some ( ( @@ -16347,7 +16352,7 @@ let read_project_metadata = ( ) p lb ) ); - | 3 -> + | 2 -> field_repo_url := ( Some ( ( @@ -16355,7 +16360,7 @@ let read_project_metadata = ( ) p lb ) ); - | 4 -> + | 3 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_repo_id := ( Some ( @@ -16365,7 +16370,7 @@ let read_project_metadata = ( ) ); ) - | 5 -> + | 4 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_org_id := ( Some ( @@ -16375,7 +16380,7 @@ let read_project_metadata = ( ) ); ) - | 6 -> + | 5 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_repo_display_name := ( Some ( @@ -16385,7 +16390,7 @@ let read_project_metadata = ( ) ); ) - | 7 -> + | 6 -> field_branch := ( Some ( ( @@ -16393,7 +16398,7 @@ let read_project_metadata = ( ) p lb ) ); - | 8 -> + | 7 -> field_commit := ( Some ( ( @@ -16401,7 +16406,7 @@ let read_project_metadata = ( ) p lb ) ); - | 9 -> + | 8 -> field_commit_title := ( Some ( ( @@ -16409,7 +16414,7 @@ let read_project_metadata = ( ) p lb ) ); - | 10 -> + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_commit_timestamp := ( Some ( @@ -16419,7 +16424,7 @@ let read_project_metadata = ( ) ); ) - | 11 -> + | 10 -> field_commit_author_email := ( Some ( ( @@ -16427,7 +16432,7 @@ let read_project_metadata = ( ) p lb ) ); - | 12 -> + | 11 -> field_commit_author_name := ( Some ( ( @@ -16435,7 +16440,7 @@ let read_project_metadata = ( ) p lb ) ); - | 13 -> + | 12 -> field_commit_author_username := ( Some ( ( @@ -16443,7 +16448,7 @@ let read_project_metadata = ( ) p lb ) ); - | 14 -> + | 13 -> field_commit_author_image_url := ( Some ( ( @@ -16451,7 +16456,7 @@ let read_project_metadata = ( ) p lb ) ); - | 15 -> + | 14 -> field_ci_job_url := ( Some ( ( @@ -16459,7 +16464,7 @@ let read_project_metadata = ( ) p lb ) ); - | 16 -> + | 15 -> field_on := ( Some ( ( @@ -16467,7 +16472,7 @@ let read_project_metadata = ( ) p lb ) ); - | 17 -> + | 16 -> field_pull_request_author_username := ( Some ( ( @@ -16475,7 +16480,7 @@ let read_project_metadata = ( ) p lb ) ); - | 18 -> + | 17 -> field_pull_request_author_image_url := ( Some ( ( @@ -16483,7 +16488,7 @@ let read_project_metadata = ( ) p lb ) ); - | 19 -> + | 18 -> field_pull_request_id := ( Some ( ( @@ -16491,7 +16496,7 @@ let read_project_metadata = ( ) p lb ) ); - | 20 -> + | 19 -> field_pull_request_title := ( Some ( ( @@ -16499,7 +16504,7 @@ let read_project_metadata = ( ) p lb ) ); - | 21 -> + | 20 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_base_sha := ( Some ( @@ -16509,7 +16514,7 @@ let read_project_metadata = ( ) ); ) - | 22 -> + | 21 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_start_sha := ( Some ( @@ -16519,7 +16524,7 @@ let read_project_metadata = ( ) ); ) - | 23 -> + | 22 -> field_is_full_scan := ( Some ( ( @@ -16527,7 +16532,7 @@ let read_project_metadata = ( ) p lb ) ); - | 24 -> + | 23 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_sca_scan := ( Some ( @@ -16537,7 +16542,7 @@ let read_project_metadata = ( ) ); ) - | 25 -> + | 24 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_code_scan := ( Some ( @@ -16547,7 +16552,7 @@ let read_project_metadata = ( ) ); ) - | 26 -> + | 25 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_is_secrets_scan := ( Some ( @@ -16566,7 +16571,6 @@ let read_project_metadata = ( with Yojson.End_of_object -> ( ( { - semgrep_version = (match !field_semgrep_version with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "semgrep_version"); scan_environment = (match !field_scan_environment with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "scan_environment"); repository = (match !field_repository with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "repository"); repo_url = (match !field_repo_url with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "repo_url"); @@ -16921,17 +16925,6 @@ let write_scan_request : _ -> scan_request -> _ = ( ) ob x; ); - (match x.meta with None -> () | Some x -> - if !is_first then - is_first := false - else - Buffer.add_char ob ','; - Buffer.add_string ob "\"meta\":"; - ( - write_raw_json - ) - ob x; - ); Buffer.add_char ob '}'; ) let string_of_scan_request ?(len = 1024) x = @@ -16945,7 +16938,6 @@ let read_scan_request = ( let field_project_metadata = ref (None) in let field_scan_metadata = ref (None) in let field_project_config = ref (None) in - let field_meta = ref (None) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -16955,14 +16947,6 @@ let read_scan_request = ( if pos < 0 || len < 0 || pos + len > String.length s then invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); match len with - | 4 -> ( - if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'a' then ( - 3 - ) - else ( - -1 - ) - ) | 13 -> ( if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'a' then ( 1 @@ -17021,16 +17005,6 @@ let read_scan_request = ( ) ); ) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_meta := ( - Some ( - ( - read_raw_json - ) p lb - ) - ); - ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -17044,14 +17018,6 @@ let read_scan_request = ( if pos < 0 || len < 0 || pos + len > String.length s then invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); match len with - | 4 -> ( - if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'a' then ( - 3 - ) - else ( - -1 - ) - ) | 13 -> ( if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'a' then ( 1 @@ -17110,16 +17076,6 @@ let read_scan_request = ( ) ); ) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_meta := ( - Some ( - ( - read_raw_json - ) p lb - ) - ); - ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -17132,7 +17088,6 @@ let read_scan_request = ( project_metadata = (match !field_project_metadata with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "project_metadata"); scan_metadata = (match !field_scan_metadata with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "scan_metadata"); project_config = !field_project_config; - meta = !field_meta; } : scan_request) ) @@ -17238,6 +17193,15 @@ let write_ci_config : _ -> ci_config -> _ = ( Yojson.Safe.write_bool ) ob x.path_to_transitivity; + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"scan_all_deps_in_diff_scan\":"; + ( + Yojson.Safe.write_bool + ) + ob x.scan_all_deps_in_diff_scan; Buffer.add_char ob '}'; ) let string_of_ci_config ?(len = 1024) x = @@ -17255,6 +17219,7 @@ let read_ci_config = ( let field_deepsemgrep = ref (false) in let field_dependency_query = ref (false) in let field_path_to_transitivity = ref (false) in + let field_scan_all_deps_in_diff_scan = ref (false) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -17326,6 +17291,14 @@ let read_ci_config = ( -1 ) ) + | 26 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 7 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -17390,6 +17363,14 @@ let read_ci_config = ( ) p lb ); ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -17465,6 +17446,14 @@ let read_ci_config = ( -1 ) ) + | 26 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 7 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -17529,6 +17518,14 @@ let read_ci_config = ( ) p lb ); ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -17545,6 +17542,7 @@ let read_ci_config = ( deepsemgrep = !field_deepsemgrep; dependency_query = !field_dependency_query; path_to_transitivity = !field_path_to_transitivity; + scan_all_deps_in_diff_scan = !field_scan_all_deps_in_diff_scan; } : ci_config) ) @@ -18314,6 +18312,15 @@ let write_scan_config : _ -> scan_config -> _ = ( ob x.path_to_transitivity; if !is_first then is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"scan_all_deps_in_diff_scan\":"; + ( + Yojson.Safe.write_bool + ) + ob x.scan_all_deps_in_diff_scan; + if !is_first then + is_first := false else Buffer.add_char ob ','; Buffer.add_string ob "\"triage_ignored_syntactic_ids\":"; @@ -18388,6 +18395,7 @@ let read_scan_config = ( let field_deepsemgrep = ref (false) in let field_dependency_query = ref (false) in let field_path_to_transitivity = ref (false) in + let field_scan_all_deps_in_diff_scan = ref (false) in let field_triage_ignored_syntactic_ids = ref ([]) in let field_triage_ignored_match_based_ids = ref ([]) in let field_ignored_files = ref ([]) in @@ -18408,7 +18416,7 @@ let read_scan_config = ( match String.unsafe_get s (pos+1) with | 'c' -> ( if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' then ( - 12 + 13 ) else ( -1 @@ -18472,7 +18480,7 @@ let read_scan_config = ( ) | 'i' -> ( if String.unsafe_get s (pos+1) = 'g' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( - 10 + 11 ) else ( -1 @@ -18502,7 +18510,7 @@ let read_scan_config = ( ) | 'e' -> ( if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'p' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'c' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 's' then ( - 11 + 12 ) else ( -1 @@ -18516,7 +18524,7 @@ let read_scan_config = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = '_' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'm' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 'c' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 'd' then ( - 13 + 14 ) else ( -1 @@ -18534,9 +18542,17 @@ let read_scan_config = ( -1 ) ) + | 26 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) | 28 -> ( if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'y' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'c' && String.unsafe_get s (pos+21) = 't' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = '_' && String.unsafe_get s (pos+25) = 'i' && String.unsafe_get s (pos+26) = 'd' && String.unsafe_get s (pos+27) = 's' then ( - 8 + 9 ) else ( -1 @@ -18544,7 +18560,7 @@ let read_scan_config = ( ) | 30 -> ( if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 'c' && String.unsafe_get s (pos+19) = 'h' && String.unsafe_get s (pos+20) = '_' && String.unsafe_get s (pos+21) = 'b' && String.unsafe_get s (pos+22) = 'a' && String.unsafe_get s (pos+23) = 's' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = 'd' && String.unsafe_get s (pos+26) = '_' && String.unsafe_get s (pos+27) = 'i' && String.unsafe_get s (pos+28) = 'd' && String.unsafe_get s (pos+29) = 's' then ( - 9 + 10 ) else ( -1 @@ -18623,6 +18639,14 @@ let read_scan_config = ( ); ) | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_triage_ignored_syntactic_ids := ( ( @@ -18630,7 +18654,7 @@ let read_scan_config = ( ) p lb ); ) - | 9 -> + | 10 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_triage_ignored_match_based_ids := ( ( @@ -18638,7 +18662,7 @@ let read_scan_config = ( ) p lb ); ) - | 10 -> + | 11 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ignored_files := ( ( @@ -18646,7 +18670,7 @@ let read_scan_config = ( ) p lb ); ) - | 11 -> + | 12 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_enabled_products := ( Some ( @@ -18656,7 +18680,7 @@ let read_scan_config = ( ) ); ) - | 12 -> + | 13 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_actions := ( ( @@ -18664,7 +18688,7 @@ let read_scan_config = ( ) p lb ); ) - | 13 -> + | 14 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ci_config_from_cloud := ( Some ( @@ -18692,7 +18716,7 @@ let read_scan_config = ( match String.unsafe_get s (pos+1) with | 'c' -> ( if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' then ( - 12 + 13 ) else ( -1 @@ -18756,7 +18780,7 @@ let read_scan_config = ( ) | 'i' -> ( if String.unsafe_get s (pos+1) = 'g' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( - 10 + 11 ) else ( -1 @@ -18786,7 +18810,7 @@ let read_scan_config = ( ) | 'e' -> ( if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = '_' && String.unsafe_get s (pos+8) = 'p' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'c' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 's' then ( - 11 + 12 ) else ( -1 @@ -18800,7 +18824,7 @@ let read_scan_config = ( match String.unsafe_get s pos with | 'c' -> ( if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = '_' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = '_' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'm' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 'c' && String.unsafe_get s (pos+16) = 'l' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 'd' then ( - 13 + 14 ) else ( -1 @@ -18818,9 +18842,17 @@ let read_scan_config = ( -1 ) ) + | 26 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) | 28 -> ( if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'y' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'c' && String.unsafe_get s (pos+21) = 't' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = '_' && String.unsafe_get s (pos+25) = 'i' && String.unsafe_get s (pos+26) = 'd' && String.unsafe_get s (pos+27) = 's' then ( - 8 + 9 ) else ( -1 @@ -18828,7 +18860,7 @@ let read_scan_config = ( ) | 30 -> ( if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = '_' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 'c' && String.unsafe_get s (pos+19) = 'h' && String.unsafe_get s (pos+20) = '_' && String.unsafe_get s (pos+21) = 'b' && String.unsafe_get s (pos+22) = 'a' && String.unsafe_get s (pos+23) = 's' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = 'd' && String.unsafe_get s (pos+26) = '_' && String.unsafe_get s (pos+27) = 'i' && String.unsafe_get s (pos+28) = 'd' && String.unsafe_get s (pos+29) = 's' then ( - 9 + 10 ) else ( -1 @@ -18907,6 +18939,14 @@ let read_scan_config = ( ); ) | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 9 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_triage_ignored_syntactic_ids := ( ( @@ -18914,7 +18954,7 @@ let read_scan_config = ( ) p lb ); ) - | 9 -> + | 10 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_triage_ignored_match_based_ids := ( ( @@ -18922,7 +18962,7 @@ let read_scan_config = ( ) p lb ); ) - | 10 -> + | 11 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ignored_files := ( ( @@ -18930,7 +18970,7 @@ let read_scan_config = ( ) p lb ); ) - | 11 -> + | 12 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_enabled_products := ( Some ( @@ -18940,7 +18980,7 @@ let read_scan_config = ( ) ); ) - | 12 -> + | 13 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_actions := ( ( @@ -18948,7 +18988,7 @@ let read_scan_config = ( ) p lb ); ) - | 13 -> + | 14 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( field_ci_config_from_cloud := ( Some ( @@ -18975,6 +19015,7 @@ let read_scan_config = ( deepsemgrep = !field_deepsemgrep; dependency_query = !field_dependency_query; path_to_transitivity = !field_path_to_transitivity; + scan_all_deps_in_diff_scan = !field_scan_all_deps_in_diff_scan; triage_ignored_syntactic_ids = !field_triage_ignored_syntactic_ids; triage_ignored_match_based_ids = !field_triage_ignored_match_based_ids; ignored_files = !field_ignored_files; @@ -31484,6 +31525,15 @@ let write_features : _ -> features -> _ = ( Yojson.Safe.write_bool ) ob x.path_to_transitivity; + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"scan_all_deps_in_diff_scan\":"; + ( + Yojson.Safe.write_bool + ) + ob x.scan_all_deps_in_diff_scan; Buffer.add_char ob '}'; ) let string_of_features ?(len = 1024) x = @@ -31498,6 +31548,7 @@ let read_features = ( let field_deepsemgrep = ref (false) in let field_dependency_query = ref (false) in let field_path_to_transitivity = ref (false) in + let field_scan_all_deps_in_diff_scan = ref (false) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -31539,6 +31590,14 @@ let read_features = ( -1 ) ) + | 26 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -31579,6 +31638,14 @@ let read_features = ( ) p lb ); ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -31624,6 +31691,14 @@ let read_features = ( -1 ) ) + | 26 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = '_' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'd' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'f' && String.unsafe_get s (pos+20) = 'f' && String.unsafe_get s (pos+21) = '_' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -31664,6 +31739,14 @@ let read_features = ( ) p lb ); ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_scan_all_deps_in_diff_scan := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) | _ -> ( Yojson.Safe.skip_json p lb ) @@ -31677,6 +31760,7 @@ let read_features = ( deepsemgrep = !field_deepsemgrep; dependency_query = !field_dependency_query; path_to_transitivity = !field_path_to_transitivity; + scan_all_deps_in_diff_scan = !field_scan_all_deps_in_diff_scan; } : features) ) diff --git a/semgrep_output_v1_j.mli b/semgrep_output_v1_j.mli index 4ed0169..945459f 100644 --- a/semgrep_output_v1_j.mli +++ b/semgrep_output_v1_j.mli @@ -238,7 +238,9 @@ type rule_result = Semgrep_output_v1_t.rule_result = { type fixtest_result = Semgrep_output_v1_t.fixtest_result = { passed: bool } -type config_error_reason = Semgrep_output_v1_t.config_error_reason +type config_error_reason = Semgrep_output_v1_t.config_error_reason = + UnparsableRule + type config_error = Semgrep_output_v1_t.config_error = { file: fpath; @@ -386,6 +388,7 @@ type engine_configuration = Semgrep_output_v1_t.engine_configuration = { deepsemgrep: bool; dependency_query: bool; path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool; ignored_files: string list; product_ignored_files: product_ignored_files option; generic_slow_rollout: bool; @@ -408,7 +411,6 @@ type scan_metadata = Semgrep_output_v1_t.scan_metadata = { } type project_metadata = Semgrep_output_v1_t.project_metadata = { - semgrep_version: version; scan_environment: string; repository: string; repo_url: uri option; @@ -445,8 +447,7 @@ type ci_config_from_repo = Semgrep_output_v1_t.ci_config_from_repo = { type scan_request = Semgrep_output_v1_t.scan_request = { project_metadata: project_metadata; scan_metadata: scan_metadata; - project_config: ci_config_from_repo option; - meta: raw_json option + project_config: ci_config_from_repo option } type ci_env = Semgrep_output_v1_t.ci_env @@ -458,7 +459,8 @@ type ci_config = Semgrep_output_v1_t.ci_config = { autofix: bool; deepsemgrep: bool; dependency_query: bool; - path_to_transitivity: bool + path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool } type action = Semgrep_output_v1_t.action @@ -479,6 +481,7 @@ type scan_config = Semgrep_output_v1_t.scan_config = { deepsemgrep: bool; dependency_query: bool; path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool; triage_ignored_syntactic_ids: string list; triage_ignored_match_based_ids: string list; ignored_files: string list; @@ -793,7 +796,8 @@ type features = Semgrep_output_v1_t.features = { autofix: bool; deepsemgrep: bool; dependency_query: bool; - path_to_transitivity: bool + path_to_transitivity: bool; + scan_all_deps_in_diff_scan: bool } type diff_file = Semgrep_output_v1_t.diff_file = {