├── cli
├── LICENSE
├── tests
│ ├── __init__.py
│ ├── qa
│ │ └── __init__.py
│ └── default
│ │ ├── e2e
│ │ ├── __init__.py
│ │ ├── rules
│ │ │ └── syntax
│ │ │ │ └── empty.yaml
│ │ ├── targets
│ │ │ ├── ignores
│ │ │ │ ├── .gitignore
│ │ │ │ ├── find.js
│ │ │ │ ├── ok
│ │ │ │ │ └── find.js
│ │ │ │ ├── ignore.min.js
│ │ │ │ ├── ignore_test.js
│ │ │ │ └── tests
│ │ │ │ │ └── ignore.js
│ │ │ ├── pro-rule-skipping
│ │ │ │ └── x.cls
│ │ │ ├── empty
│ │ │ │ └── totally_empty_file
│ │ │ ├── rule_id
│ │ │ │ └── hello.txt
│ │ │ ├── dependency_aware
│ │ │ │ ├── pnpm
│ │ │ │ │ └── foo.js
│ │ │ │ ├── js
│ │ │ │ │ └── sca.js
│ │ │ │ ├── ruby
│ │ │ │ │ └── sca.rb
│ │ │ │ ├── yarn2
│ │ │ │ │ └── foo.js
│ │ │ │ ├── generic
│ │ │ │ │ └── generic.txt
│ │ │ │ ├── monorepo
│ │ │ │ │ └── build.js
│ │ │ │ ├── pnpm-error-key
│ │ │ │ │ └── foo.js
│ │ │ │ ├── poetry
│ │ │ │ │ └── sca-poetry.py
│ │ │ │ ├── requirement
│ │ │ │ │ └── foo.py
│ │ │ │ ├── requirements
│ │ │ │ │ └── foo.py
│ │ │ │ └── requirements3
│ │ │ │ │ └── foo.py
│ │ │ ├── deduplication
│ │ │ │ └── deduplication.py
│ │ │ ├── ignores_default
│ │ │ │ ├── .gitignore
│ │ │ │ ├── find.js
│ │ │ │ └── ignore.min.js
│ │ │ ├── language-filtering
│ │ │ │ ├── call-f.py
│ │ │ │ └── call-f.js
│ │ │ ├── multilangproj
│ │ │ │ └── code.js
│ │ │ ├── per-rule-include
│ │ │ │ ├── scan-me.py
│ │ │ │ └── dont-scan-me.py
│ │ │ ├── pro-rule-skipping-no-parsing
│ │ │ │ └── x.cls
│ │ │ ├── sort-findings
│ │ │ │ ├── z
│ │ │ │ │ └── a.py
│ │ │ │ ├── b.py
│ │ │ │ └── c.py
│ │ │ ├── basic
│ │ │ │ └── simple_python_no_extension
│ │ │ └── version-constraints
│ │ │ │ └── x.py
│ │ └── snapshots
│ │ │ └── test_baseline
│ │ │ ├── test_renamed_dir
│ │ │ └── diff.out
│ │ │ └── test_unstaged_changes
│ │ │ └── output.txt
│ │ ├── consistency
│ │ └── __init__.py
│ │ └── e2e-other
│ │ ├── rules
│ │ └── targets
├── src
│ ├── semdep
│ │ ├── __init__.py
│ │ ├── external
│ │ │ ├── __init__.py
│ │ │ ├── packaging
│ │ │ │ └── py.typed
│ │ │ └── parsy
│ │ │ │ └── version.py
│ │ ├── matchers
│ │ │ └── __init__.py
│ │ └── parsers
│ │ │ └── __init__.py
│ └── semgrep
│ │ ├── app
│ │ └── __init__.py
│ │ ├── commands
│ │ └── __init__.py
│ │ ├── external
│ │ └── __init__.py
│ │ ├── formatter
│ │ └── __init__.py
│ │ ├── console_scripts
│ │ └── __init__.py
│ │ └── __init__.py
└── stubs
│ ├── ruamel
│ └── __init__.py
│ ├── boltons
│ ├── deprutils.pyi
│ ├── easterutils.pyi
│ ├── excutils.pyi
│ ├── mboxutils.pyi
│ └── typeutils.pyi
│ └── packaging
│ └── __init__.py
├── tests
├── TODO
│ ├── basic.sgrep
│ ├── metavar.sgrep
│ ├── string.sgrep
│ ├── unify.sgrep
│ ├── global.py
│ ├── name_metavar.sgrep
│ ├── stmt_basic.sgrep
│ ├── bad.py
│ ├── dots.sgrep
│ ├── stmt_metavar.sgrep
│ ├── stmt.sgrep
│ ├── foo.js
│ ├── stmt_dots.sgrep
│ ├── expr_vs_stmt_metavar.sgrep
│ ├── stmt_ellipsis.sgrep
│ ├── stupid_if.sgrep
│ └── protocol.sgrep
├── misc
│ ├── otarzan
│ │ ├── poly.ml
│ │ ├── record.ml
│ │ └── stmt.ml
│ ├── il
│ │ ├── var.py
│ │ ├── assert.py
│ │ ├── basic.py
│ │ ├── call.py
│ │ ├── container.py
│ │ ├── var.js
│ │ └── array.js
│ └── target_file
│ │ └── target_file.list
├── perf
│ ├── eq.sgrep
│ └── bloom
│ │ ├── stmts-ellipsis.sgrep
│ │ └── stmts-mv-ellipsis.sgrep
├── patterns
│ ├── bash
│ │ ├── empty.bash
│ │ ├── empty.sgrep
│ │ ├── assign.sgrep
│ │ ├── concatenation.sgrep
│ │ ├── not.sgrep
│ │ ├── or.sgrep
│ │ ├── assign-add.sgrep
│ │ ├── background.sgrep
│ │ ├── case-body.sgrep
│ │ ├── expression.sgrep
│ │ ├── for-body.sgrep
│ │ ├── hello.sgrep
│ │ ├── if-body.sgrep
│ │ ├── if-header.sgrep
│ │ ├── match-cmd-or-arg.sgrep
│ │ ├── subshell.sgrep
│ │ ├── todo
│ │ │ ├── deep_exprstmt.sgrep
│ │ │ ├── assign-multi.sgrep
│ │ │ ├── var-ellipsis-var.bash
│ │ │ ├── array-named-ellipsis.sgrep
│ │ │ └── var-ellipsis-var.sgrep
│ │ ├── added_identifier.sh
│ │ ├── anchored-stmt.sgrep
│ │ ├── array-ellipsis.sgrep
│ │ ├── concrete_syntax.sgrep
│ │ ├── dots_args.sgrep
│ │ ├── dots_string.sgrep
│ │ ├── function-body.sgrep
│ │ ├── metavar_arg.sgrep
│ │ ├── not-an-expression1.sgrep
│ │ ├── pipeline.sgrep
│ │ ├── quoted-ellipsis.sgrep
│ │ ├── quoted-expansion.sgrep
│ │ ├── select-body.sgrep
│ │ ├── set-lhs-metavar.sgrep
│ │ ├── stmt-ellipsis.sgrep
│ │ ├── while-body.sgrep
│ │ ├── arg-ellipsis.sgrep
│ │ ├── deep_exprstmt.sgrep
│ │ ├── metavar_call.sgrep
│ │ ├── not-an-expression2.sgrep
│ │ ├── not-an-expression3.sgrep
│ │ ├── not-an-expression4.sgrep
│ │ ├── not-an-expression5.sgrep
│ │ ├── set-rhs-metavar.sgrep
│ │ ├── anonymous_metavar.bash
│ │ ├── concatenation.bash
│ │ ├── function.sgrep
│ │ ├── quoted-ellipsis2.sgrep
│ │ ├── quoted-named-ellipsis.sgrep
│ │ ├── set-lhs-metavar.bash
│ │ ├── arg-named-ellipsis.sgrep
│ │ ├── assign.bash
│ │ ├── command-substitution-body.sgrep
│ │ ├── command-substitution.sgrep
│ │ ├── concatenation-ellipsis.sgrep
│ │ ├── deep_expr_operator.sgrep
│ │ ├── metavar_equality_expr.sgrep
│ │ ├── normalize-dquoted-word.sgrep
│ │ ├── normalize-squoted-word.sgrep
│ │ ├── not-an-expression4.bash
│ │ ├── set-rhs-metavar.bash
│ │ ├── stmt-named-ellipsis.sgrep
│ │ ├── command-substitution.bash
│ │ ├── concatenation-ellipsis.bash
│ │ ├── declaration-assignments.sgrep
│ │ ├── dots_stmts.sgrep
│ │ └── nested_stmts.sgrep
│ ├── yaml
│ │ ├── empty.yaml
│ │ ├── empty.sgrep
│ │ ├── tag_literal.sgrep
│ │ ├── tag_metavar.sgrep
│ │ ├── unicode.sgrep
│ │ ├── metavar_field.sgrep
│ │ ├── post_unicode.sgrep
│ │ ├── semgrep
│ │ │ ├── ellipses_only.sgrep
│ │ │ └── field.sgrep
│ │ ├── array_field_only.sgrep
│ │ ├── anonymous_metavar.yaml
│ │ ├── misc_other_formats_braces.sgrep
│ │ └── metavar_field.yaml
│ ├── generic
│ │ ├── minified.sgrep
│ │ ├── not-minified.sgrep
│ │ ├── dots_string.sgrep
│ │ ├── dots_args.sgrep
│ │ └── metavar_stmt.sgrep
│ ├── go
│ │ ├── cp_ref.sgrep
│ │ ├── imports2.sgrep
│ │ ├── struct_tags.sgrep
│ │ ├── imports.sgrep
│ │ ├── metavar_expr.sgrep
│ │ ├── imports3.sgrep
│ │ ├── imports_prefix.sgrep
│ │ ├── misc_noteq.sgrep
│ │ ├── string_literals.sgrep
│ │ ├── struct_tags_one.sgrep
│ │ ├── typing-make.sgrep
│ │ ├── dots_for.sgrep
│ │ ├── imports_metavar.sgrep
│ │ ├── metavar_package.sgrep
│ │ ├── metavar_typed.sgrep
│ │ ├── misc_exprstmt_vs_expr.sgrep
│ │ ├── misc_import.sgrep
│ │ ├── misc_package.sgrep
│ │ ├── package_metavar.sgrep
│ │ ├── partial_single_field.sgrep
│ │ ├── anonymous_metavar.go
│ │ ├── make_tri_pat.sgrep
│ │ ├── misc_empty_body.sgrep
│ │ ├── regexp_caret.sgrep
│ │ ├── cp_shortassign.sgrep
│ │ ├── dots_nested_stmts.sgrep
│ │ ├── dots_package.sgrep
│ │ ├── dots_stmts.sgrep
│ │ ├── equivalence_naming_import1.sgrep
│ │ ├── make-args-trans.sgrep
│ │ ├── make_metavar_firstarg.sgrep
│ │ ├── metavar_cond.sgrep
│ │ ├── metavar_stmt.sgrep
│ │ ├── misc_interface_method.sgrep
│ │ ├── misc_type_decl.sgrep
│ │ ├── dots_params.sgrep
│ │ ├── equivalence_constant_dataflow.sgrep.TODO
│ │ ├── equivalence_naming_import.sgrep
│ │ ├── equivalence_naming_import2.sgrep
│ │ ├── metavar_typed_lefthand.sgrep
│ │ ├── metavar_typed_literal.sgrep
│ │ ├── misc_assignop.sgrep
│ │ ├── misc_tuple_order.sgrep
│ │ └── partial_initbraces.sgrep
│ ├── ts
│ │ ├── opt_chain.sgrep
│ │ ├── misc_ast.sgrep
│ │ ├── misc_method.sgrep
│ │ ├── misc_naming_recursion.sgrep
│ │ ├── misc_semicolon.sgrep
│ │ ├── import_vN.sgrep
│ │ ├── anonymous_metavar.ts
│ │ ├── less_type_let.sgrep
│ │ ├── metavar_typed_class.sgrep
│ │ ├── misc_as_cast.sgrep
│ │ ├── misc_type3.sgrep
│ │ ├── type_assert.sgrep
│ │ ├── dots_params.sgrep
│ │ ├── dots_type_literal.sgrep
│ │ ├── equivalence_decl_vs_assign.sgrep
│ │ ├── import_vN.ts
│ │ ├── metavar_import.sgrep
│ │ ├── metavar_typed_expr.sgrep
│ │ ├── misc_semicolon.ts
│ │ ├── misc_type1.sgrep
│ │ ├── misc_type2.sgrep
│ │ ├── deep_record.sgrep
│ │ ├── misc_function.sgrep
│ │ └── record_functions.sgrep
│ ├── cp_exception.sgrep
│ ├── js
│ │ ├── eval_call.sgrep
│ │ ├── cp_incrdecr.sgrep
│ │ ├── dots_regexp.sgrep
│ │ ├── misc_arrow.sgrep
│ │ ├── misc_new.sgrep
│ │ ├── cp_array_destructure.sgrep
│ │ ├── cp_label.sgrep
│ │ ├── cp_throw.sgrep
│ │ ├── dots_container.sgrep
│ │ ├── misc_null_cast.sgrep
│ │ ├── misc_string.sgrep
│ │ ├── misc_unicode.sgrep
│ │ ├── regexp.sgrep
│ │ ├── caching_deep.sgrep
│ │ ├── caching_flat.sgrep
│ │ ├── cp_conditional.sgrep
│ │ ├── cp_dataflow.sgrep
│ │ ├── deep_jsx.sgrep
│ │ ├── dots_jsx_attr.sgrep
│ │ ├── dots_jsx_body2.sgrep
│ │ ├── dots_object2.sgrep
│ │ ├── infer_const.sgrep
│ │ ├── metavar_regexp.sgrep
│ │ ├── misc_arrow2.sgrep
│ │ ├── misc_jsx.sgrep
│ │ ├── misc_regexp_modifier.sgrep
│ │ ├── misc_yield_undefined.sgrep
│ │ ├── object_numeric_key.sgrep
│ │ ├── semgrep
│ │ │ ├── jsx.sgrep
│ │ │ └── metavar_jsx.sgrep
│ │ ├── anonymous_metavar.js
│ │ ├── caching_nested.sgrep
│ │ ├── cp_undeclared.sgrep
│ │ ├── cp_undeclared1.sgrep
│ │ ├── dots_container2.sgrep
│ │ ├── dots_field_chaining.sgrep
│ │ ├── dots_jsx_body.sgrep
│ │ ├── infer_const_regexp.sgrep
│ │ ├── metavar_jsx_attr.sgrep
│ │ ├── metavar_jsx_tag.sgrep
│ │ ├── metavar_jsx_val.sgrep
│ │ ├── metavar_template.sgrep
│ │ ├── misc_asi_pattern.sgrep
│ │ ├── misc_empty_body.sgrep
│ │ ├── misc_method_brace_newline.sgrep
│ │ ├── misc_notoken.sgrep
│ │ ├── misc_object_directly.sgrep
│ │ ├── partial_catch.sgrep
│ │ ├── partial_function.sgrep
│ │ ├── template_string_w_metavar.sgrep
│ │ ├── caching_deep_metavar.sgrep
│ │ ├── cp_implicit_conversion.sgrep
│ │ ├── deep_expr_xml.sgrep
│ │ ├── dots_jsx_attr_list.sgrep
│ │ ├── dots_params.sgrep
│ │ ├── equivalence_varlet.sgrep
│ │ ├── less_class_complex.sgrep
│ │ ├── less_xml_body.sgrep
│ │ ├── metavar_import.sgrep
│ │ ├── metavar_typed_bool.sgrep
│ │ ├── misc_expr_vs_vardef.sgrep
│ │ ├── misc_field_vs_vardef.sgrep
│ │ ├── misc_lambda.sgrep
│ │ ├── misc_string.js
│ │ ├── regexp.js
│ │ ├── switch_case_pattern.sgrep
│ │ ├── typed_metavar_assign.sgrep
│ │ ├── aliasing_require.sgrep
│ │ ├── deep_cond.sgrep
│ │ ├── deep_expr_vs_statement.sgrep
│ │ ├── dots_importfrom.sgrep
│ │ ├── dots_object.sgrep
│ │ ├── dots_regexp.js
│ │ ├── dots_template_literals.sgrep
│ │ ├── equivalence_constant_propagation2.sgrep
│ │ ├── equivalence_constant_propagation3.sgrep
│ │ ├── equivalence_keyword_args.sgrep
│ │ ├── metavar_importfrom.sgrep
│ │ ├── metavar_typed_literal.sgrep
│ │ ├── misc_faketok.sgrep
│ │ ├── misc_new.js
│ │ ├── misc_this.sgrep
│ │ └── partial_single_field.sgrep
│ ├── php
│ │ ├── foo.sgrep
│ │ ├── misc_goto.sgrep
│ │ ├── dots_echo.sgrep
│ │ ├── dots_eval.sgrep
│ │ ├── gh_5880.sgrep
│ │ ├── cp_builtin.sgrep
│ │ ├── cp_global.sgrep
│ │ ├── cp_import.sgrep
│ │ ├── dots_backquote.sgrep
│ │ ├── dots_include.sgrep
│ │ ├── sgrep
│ │ │ ├── foo_expr.sgrep
│ │ │ ├── expr_pattern.php
│ │ │ ├── multi.sgrep
│ │ │ ├── dots_in_brackets.php
│ │ │ ├── statement_pattern.php
│ │ │ ├── argref.php
│ │ │ └── regexp.sgrep
│ │ ├── spatch
│ │ │ ├── errors
│ │ │ │ ├── missing_paren.php
│ │ │ │ └── missing_paren.spatch
│ │ │ ├── todo
│ │ │ │ └── 1.php
│ │ │ ├── bar.exp
│ │ │ ├── bar.php
│ │ │ ├── static_scalar.spatch
│ │ │ ├── remove_whole_line.spatch
│ │ │ ├── bar.spatch
│ │ │ ├── new.spatch
│ │ │ ├── remove_space_between.spatch
│ │ │ ├── remove_trailing_comment.spatch
│ │ │ └── xhp_metavar.spatch
│ │ ├── case_insensitive_function_id.sgrep
│ │ ├── dots_args_isset.sgrep
│ │ ├── dots_array.sgrep
│ │ ├── dots_include1.sgrep
│ │ ├── backed_enum.sgrep
│ │ ├── constant_propogation.sgrep
│ │ ├── dots_interpolated.sgrep
│ │ ├── gh_5594.sgrep
│ │ ├── misc_boolean_propagation.sgrep
│ │ ├── dots_args_in_block.sgrep
│ │ ├── metavar_underscore.sgrep
│ │ ├── named_arguments.sgrep
│ │ ├── naming_origname_use_group.sgrep
│ │ ├── dots_echo.php
│ │ ├── foo.php
│ │ ├── metavar_anno.sgrep
│ │ └── naming_rename_use_group.sgrep
│ ├── ruby
│ │ ├── blocks.sgrep
│ │ ├── dots_regexp.sgrep
│ │ ├── blocks1.sgrep
│ │ ├── dots_atom.sgrep
│ │ ├── foo.sgrep
│ │ ├── misc_div0.sgrep
│ │ ├── misc_dot_call.sgrep
│ │ ├── misc_parsing1.sgrep
│ │ ├── misc_parsing2.sgrep
│ │ ├── regexp_ellipsis.sgrep
│ │ ├── regexp_literal.sgrep
│ │ ├── call_expr_property.sgrep
│ │ ├── cp_assign.sgrep
│ │ ├── cp_concat.sgrep
│ │ ├── metavar_interpolated.sgrep
│ │ ├── misc_backticks.sgrep
│ │ ├── misc_bitand.sgrep
│ │ ├── misc_range.sgrep
│ │ ├── regexp_metavar.sgrep
│ │ ├── regexp_template.sgrep
│ │ ├── cp_interpolated.sgrep
│ │ ├── deep_exprstmt.sgrep
│ │ ├── dots_struct_new.sgrep
│ │ ├── implicit_return.sgrep
│ │ ├── lambda.sgrep
│ │ ├── metavar_atom.sgrep
│ │ ├── metavar_import.sgrep
│ │ ├── misc_dotaccess.sgrep
│ │ ├── misc_hidden_call.sgrep
│ │ ├── misc_multiple_assign.sgrep
│ │ ├── anonymous_metavar.rb
│ │ ├── cp_string_mutable.sgrep
│ │ ├── metavar_regexp.sgrep
│ │ ├── misc_empty_token1.sgrep
│ │ ├── misc_kwdarg2.sgrep
│ │ ├── misc_kwdarg_dots.sgrep
│ │ ├── command_call_with_ellipsis.sgrep
│ │ ├── deep_expr_operator.sgrep
│ │ ├── metavar_classname.sgrep
│ │ ├── misc_backtick_interp.sgrep
│ │ ├── dots_interpolated_string.sgrep
│ │ ├── dots_multiple_interpolated.sgrep
│ │ ├── metavar_cond.sgrep
│ │ ├── metavar_import.rb
│ │ ├── misc_kwdarg_dots.rb
│ │ ├── misc_multiple_assign.rb
│ │ ├── misc_multiple_assign_uneq_lists.rb
│ │ └── misc_multiple_assign_uneq_lists.sgrep
│ ├── swift
│ │ ├── match_name.sgrep
│ │ ├── typed_metavar.sgrep
│ │ ├── if_let.sgrep
│ │ ├── keypath.sgrep
│ │ ├── class_variants.sgrep
│ │ ├── semgrep_ellipsis.sgrep
│ │ ├── class_ellipsis.sgrep
│ │ ├── anonymous_metavar.swift
│ │ ├── if_let.swift
│ │ ├── semgrep_ellipsis_no_semi.sgrep
│ │ ├── unbounded_range_ellipsis.sgrep
│ │ └── dots_nested_stmts.sgrep
│ ├── POLYGLOT
│ │ ├── dots_expr.sgrep
│ │ ├── anonymous_metavar.sgrep
│ │ ├── dots_args.sgrep
│ │ ├── dots_string.sgrep
│ │ ├── metavar_arg.sgrep
│ │ ├── metavar_call.sgrep
│ │ ├── concrete_syntax.sgrep
│ │ ├── equivalence_float.sgrep
│ │ ├── metavar_string.sgrep
│ │ ├── partial_class.sgrep
│ │ ├── partial_if.sgrep
│ │ ├── dots_for.sgrep
│ │ ├── equivalence_number.sgrep
│ │ ├── metavar_equality_expr.sgrep
│ │ ├── partial_try.sgrep
│ │ ├── deep_exprstmt.sgrep
│ │ ├── metavar_cond.sgrep
│ │ ├── partial_finally.sgrep
│ │ ├── deep_expr_operator.sgrep
│ │ ├── metavar_stmt.sgrep
│ │ └── regexp_pcre.sgrep
│ ├── cpp
│ │ ├── block_ellipsis.sgrep
│ │ ├── standalone_expr.sgrep
│ │ ├── toplevel_ellipsis.sgrep
│ │ ├── typed_metavar.sgrep
│ │ ├── named_ellipsis.sgrep
│ │ ├── misc_include.sgrep
│ │ ├── anonymous_metavar.cpp
│ │ ├── dots_params.sgrep
│ │ ├── dots_namespace.sgrep
│ │ └── misc_const.sgrep
│ ├── dockerfile
│ │ ├── arg.sgrep
│ │ ├── run.sgrep
│ │ ├── expose.sgrep
│ │ ├── from.sgrep
│ │ ├── user.sgrep
│ │ ├── arg-metavar.sgrep
│ │ ├── cmd-ellipsis.sgrep
│ │ ├── cmd-shell.sgrep
│ │ ├── dots_args.sgrep
│ │ ├── dots_string.sgrep
│ │ ├── env-const-prop.sgrep
│ │ ├── env-ellipsis.sgrep
│ │ ├── from-param.sgrep
│ │ ├── label.sgrep
│ │ ├── metavar_arg.sgrep
│ │ ├── no-trailing-newline.sgrep
│ │ ├── onbuild.sgrep
│ │ ├── run-anchored.sgrep
│ │ ├── volume.sgrep
│ │ ├── add.sgrep
│ │ ├── array-metavariable.sgrep
│ │ ├── copy-ellipsis.sgrep
│ │ ├── copy-metavar.sgrep
│ │ ├── deep_exprstmt.sgrep
│ │ ├── from-as.sgrep
│ │ ├── label-ellipsis.sgrep
│ │ ├── metavar_call.sgrep
│ │ ├── multiline_comment.sgrep
│ │ ├── string-comparison.sgrep
│ │ ├── user-group.sgrep
│ │ ├── array-ellipsis.sgrep
│ │ ├── cmd-argv.sgrep
│ │ ├── cmd-named-ellipsis.sgrep
│ │ ├── copy.sgrep
│ │ ├── entrypoint.sgrep
│ │ ├── env-val-metavar.sgrep
│ │ ├── env.sgrep
│ │ ├── from2.sgrep
│ │ ├── instruction-metavariable.sgrep
│ │ ├── label-metavar.sgrep
│ │ ├── maintainer.sgrep
│ │ ├── run-argv.sgrep
│ │ ├── stopsignal.sgrep
│ │ ├── todo
│ │ │ ├── env-key-metavar.sgrep
│ │ │ └── string-fragments.sgrep
│ │ ├── volume-metavar.sgrep
│ │ ├── workdir.sgrep
│ │ ├── arg-default-metavar.sgrep
│ │ ├── copy-param.sgrep
│ │ ├── entrypoint-ellipsis.sgrep
│ │ ├── expose-metavar.sgrep
│ │ ├── healthcheck-ellipsis.sgrep
│ │ ├── healthcheck-none.sgrep
│ │ ├── label-variable-key.sgrep
│ │ ├── run-param-metavar.sgrep
│ │ ├── run-param.sgrep
│ │ ├── stopsignal-metavar.sgrep
│ │ ├── user-group-metavar.sgrep
│ │ └── workdir-metavar.sgrep
│ ├── julia
│ │ ├── op_plus.sgrep
│ │ ├── using_import.sgrep
│ │ ├── import_import.sgrep
│ │ ├── using_alias.sgrep
│ │ ├── implicit_return.sgrep
│ │ ├── import_alias.sgrep
│ │ ├── import_metavar.sgrep
│ │ ├── anonymous_metavar.jl
│ │ ├── let_ellipsis.sgrep
│ │ ├── op_plus.jl
│ │ └── dots_nested_stmts.sgrep
│ ├── kotlin
│ │ ├── string_metavar.sgrep
│ │ ├── in_class_typing.sgrep
│ │ ├── not_string_metavar.sgrep
│ │ ├── anonymous_metavar.kt
│ │ ├── deep_exprstmt.sgrep
│ │ ├── in_class_const_prop.sgrep
│ │ ├── interpolated_ident.sgrep
│ │ ├── metavar_typed.sgrep
│ │ ├── single_interpolated_ident.sgrep
│ │ ├── metavar_cond.sgrep
│ │ ├── metavar_import.sgrep
│ │ ├── metavar_stmt.sgrep
│ │ └── misc_call_in_assign.sgrep
│ ├── lua
│ │ ├── assignment.sgrep
│ │ ├── comparison.sgrep
│ │ └── anonymous_metavar.lua
│ ├── ocaml
│ │ ├── foo.sgrep
│ │ ├── dots_args.sgrep
│ │ ├── dots_string.sgrep
│ │ ├── local_open.sgrep
│ │ ├── metavar_arg.sgrep
│ │ ├── metavar_call.sgrep
│ │ ├── misc_notokenloc.sgrep
│ │ ├── partial_if.sgrep
│ │ ├── partial_match.sgrep
│ │ ├── partial_try.sgrep
│ │ ├── regexp.sgrep
│ │ ├── concrete_syntax.sgrep
│ │ ├── dots_params.sgrep
│ │ ├── equivalence_number.sgrep
│ │ ├── misc_ctor_one_arg.sgrep
│ │ ├── misc_match_case.sgrep
│ │ ├── dots_let_body.sgrep
│ │ ├── metavar_equality_expr.sgrep
│ │ ├── misc_functor.sgrep
│ │ ├── misc_try.sgrep
│ │ ├── partial_let.sgrep
│ │ ├── aliasing_qualified.sgrep
│ │ ├── metavar_cond.sgrep
│ │ ├── metavar_func_def.sgrep
│ │ ├── dots_nested_stmts.sgrep
│ │ ├── metavar_stmt.sgrep
│ │ └── misc_useless_else.sgrep
│ ├── promql
│ │ ├── func.sgrep
│ │ ├── binary_ellipsis.sgrep
│ │ ├── selector_ellipsis.sgrep
│ │ ├── selector_with_name_label.sgrep
│ │ ├── subquery.sgrep
│ │ ├── subquery_in_func.sgrep
│ │ ├── anonymous_metavar.promql
│ │ ├── grouping.sgrep
│ │ ├── selector.sgrep
│ │ ├── selector_without_labels.sgrep
│ │ └── subquery_vs_range_selector.sgrep
│ ├── python
│ │ ├── cp_label.sgrep
│ │ ├── cp_rlval.sgrep
│ │ ├── dots_list.sgrep
│ │ ├── index_tuple.sgrep
│ │ ├── parenthesized_with.sgrep
│ │ ├── scoped_wildcard.sgrep
│ │ ├── concrete_fstring.sgrep
│ │ ├── cp_concat.sgrep
│ │ ├── cp_exception.sgrep
│ │ ├── cp_label1.sgrep
│ │ ├── cp_with.sgrep
│ │ ├── cp_yield.sgrep
│ │ ├── dots_fstring.sgrep
│ │ ├── imports.sgrep
│ │ ├── metavar_tuple.sgrep
│ │ ├── misc_faketok3.sgrep
│ │ ├── misc_match_stmt.sgrep
│ │ ├── python2.sgrep
│ │ ├── set_vs_dict.sgrep
│ │ ├── wildcard_qualified.sgrep
│ │ ├── ac_matching_free.sgrep
│ │ ├── ac_matching_mvars.sgrep
│ │ ├── ac_matching_mvars2.sgrep
│ │ ├── cp_eval1.sgrep
│ │ ├── cp_eval2.sgrep
│ │ ├── cp_string_mvar.sgrep
│ │ ├── cp_strings.sgrep
│ │ ├── deep_exprstmt.sgrep
│ │ ├── dots_return.sgrep
│ │ ├── metavar_import.sgrep
│ │ ├── metavar_typed.sgrep
│ │ ├── misc_fake_propa.sgrep
│ │ ├── misc_faketok2.sgrep
│ │ ├── misc_metavar_vs_fstring.sgrep
│ │ ├── misc_prefix_string.sgrep
│ │ ├── misc_with_no_rename.sgrep
│ │ ├── wildcard_qualified_mvar.sgrep
│ │ ├── ac_matching_dots.sgrep
│ │ ├── ac_matching_dots1.sgrep
│ │ ├── ac_matching_explosion1.sgrep
│ │ ├── ac_matching_free1.sgrep
│ │ ├── ac_matching_mvars1.sgrep
│ │ ├── anonymous_metavar.py
│ │ ├── any_qualified_with_wildcard.sgrep
│ │ ├── assoc_matching_mvars.sgrep
│ │ ├── constprop_dataflow.sgrep
│ │ ├── dots_expr.py
│ │ ├── dots_expr_plus.sgrep
│ │ ├── dots_tuples.sgrep
│ │ ├── import_negatives.sgrep
│ │ ├── metavar_set.sgrep
│ │ ├── misc_return_empty.sgrep
│ │ ├── misc_stmts1.sgrep
│ │ ├── multi_import.sgrep
│ │ ├── multi_qualified_wildcard.sgrep
│ │ ├── ac_matching_explosion.sgrep
│ │ ├── ac_matching_if1.sgrep
│ │ ├── aliasing_and_direct.sgrep
│ │ ├── already_resolved_with_wildcard.sgrep
│ │ ├── assoc_matching_bug.sgrep
│ │ ├── assoc_matching_dots.sgrep
│ │ ├── assoc_matching_free.sgrep
│ │ ├── assoc_matching_free1.sgrep
│ │ ├── assoc_matching_mvars1.sgrep
│ │ ├── cp_method_call.sgrep
│ │ ├── cp_python_mult_string1.sgrep
│ │ ├── deep_expr_operator.sgrep
│ │ ├── df_input.sgrep
│ │ ├── dots_inherit.sgrep
│ │ ├── equivalence_interpolated_str.sgrep
│ │ ├── import_metavar_fullpath.sgrep
│ │ ├── import_negatives2.sgrep
│ │ ├── less_inherits.sgrep
│ │ ├── metavar_cond.sgrep
│ │ ├── metavar_dict.sgrep
│ │ ├── metavar_iterator.sgrep
│ │ ├── metavar_stmt.sgrep
│ │ ├── metavar_tuple.py
│ │ ├── misc_encoded_string.sgrep
│ │ ├── set_vs_dict3.sgrep
│ │ ├── standalone_decorator.sgrep
│ │ ├── stmts_to_fields.sgrep
│ │ ├── visitor_def.sgrep
│ │ ├── assoc_matching_dots1.sgrep
│ │ ├── assoc_matching_explosion.sgrep
│ │ ├── cp_label1.py
│ │ ├── dots_params.sgrep
│ │ ├── dots_tuples.py
│ │ ├── equivalence_constant_propagation.sgrep
│ │ ├── equivalence_interpolated_str2.sgrep
│ │ ├── equivalence_naming_import.sgrep
│ │ ├── less_typehint.sgrep
│ │ ├── metavar_class_def.sgrep
│ │ ├── metavar_func_def.sgrep
│ │ ├── misc_block_import.sgrep
│ │ ├── misc_comprehension.sgrep
│ │ ├── misc_faketok1.sgrep
│ │ ├── misc_paren.sgrep
│ │ ├── misc_tuple2.sgrep
│ │ ├── regexp_string_backref.sgrep
│ │ └── set_vs_dict2.sgrep
│ ├── ql
│ │ ├── metavar_anno.sgrep
│ │ ├── metavar_equality_expr.sgrep
│ │ ├── dots_expr.sgrep
│ │ ├── deep_expr_operator.sgrep
│ │ ├── dots_module.sgrep
│ │ ├── dots_predicate.sgrep
│ │ └── metavar_anno.ql
│ ├── rust
│ │ ├── metavar_standalone.sgrep
│ │ ├── misc_return_3.sgrep
│ │ ├── metavar_import.sgrep
│ │ ├── misc_macrocall.sgrep
│ │ ├── misc_scoped_idents.sgrep
│ │ ├── cp_expr_stmt_if.sgrep
│ │ ├── dots_mod.sgrep
│ │ ├── implicit_return.sgrep
│ │ ├── metavar_standalone.rs
│ │ ├── misc_scoped_idents_as.sgrep
│ │ ├── anonymous_metavar.rs
│ │ ├── dots_field_chaining.sgrep
│ │ ├── dots_macro_call.sgrep
│ │ ├── epattern_type_prop.sgrep
│ │ ├── metavar_param.sgrep
│ │ ├── metavar_class_def.sgrep
│ │ ├── metavar_cond.sgrep
│ │ ├── metavar_func_def.sgrep
│ │ ├── dots_struct.sgrep
│ │ └── metavar_ellipsis.sgrep
│ ├── scala
│ │ ├── metavar_atom.sgrep
│ │ ├── misc_symbol.sgrep
│ │ ├── apply_as_new.sgrep
│ │ ├── dots_atom.sgrep
│ │ ├── infix_method.sgrep
│ │ ├── metavar_typed.sgrep
│ │ ├── pat_def.sgrep
│ │ ├── tuple_def.sgrep
│ │ ├── custom_interpolated.sgrep
│ │ ├── dots_match.sgrep
│ │ ├── implicit_return.sgrep
│ │ ├── import_metavariable.sgrep
│ │ ├── minus_identifier.sgrep
│ │ ├── anonymous_metavar.scala
│ │ ├── class_params.sgrep
│ │ ├── catch_ellipsis.sgrep
│ │ ├── metavar_cond.sgrep
│ │ ├── metavar_func_def.sgrep
│ │ ├── metavar_pat.sgrep
│ │ ├── metavar_stmt.sgrep
│ │ ├── pat_ellipsis.sgrep
│ │ ├── equivalence_naming_import.sgrep
│ │ └── metavar_key_value.sgrep
│ ├── c
│ │ ├── dots_sizeof.sgrep
│ │ ├── metavar_import.sgrep
│ │ ├── anonymous_metavar.c
│ │ ├── dots_params.sgrep
│ │ ├── metavar_typed.sgrep
│ │ ├── const-prop-buf-decl.sgrep
│ │ ├── misc_typedef_inference.sgrep
│ │ ├── const-prop-buf-decl-flow.sgrep
│ │ ├── misc_toplevel_macrocall.sgrep
│ │ └── metavar_typed_generic.sgrep
│ ├── csharp
│ │ ├── concrete_syntax.sgrep
│ │ ├── dots_args.sgrep
│ │ ├── loops.sgrep
│ │ ├── metavar_import.sgrep
│ │ ├── deep_expr_operator.sgrep
│ │ ├── dots_class.sgrep
│ │ ├── dots_string.sgrep
│ │ ├── metavar_arg.sgrep
│ │ ├── metavar_class_def.sgrep
│ │ ├── metavar_cond.sgrep
│ │ ├── metavar_equality_expr.sgrep
│ │ ├── metavar_typed.sgrep
│ │ ├── metavar_key_value.sgrep
│ │ ├── decl_before_init.sgrep
│ │ ├── metavar_anno.sgrep
│ │ ├── metavar_ellipsis_new_args.sgrep
│ │ ├── metavar_func_def.sgrep
│ │ └── metavar_stmt.sgrep
│ ├── java
│ │ ├── better_import1.sgrep
│ │ ├── better_import2.sgrep
│ │ ├── better_import3.sgrep
│ │ ├── cp_foreach.sgrep
│ │ ├── cp_try_return.sgrep
│ │ ├── misc_annot.sgrep
│ │ ├── misc_assert.sgrep
│ │ ├── better_import4.sgrep
│ │ ├── cp_switch_throw.sgrep
│ │ ├── cp_synchronized.sgrep
│ │ ├── cp_synchronized1.sgrep
│ │ ├── metavar_idspecial.sgrep
│ │ ├── metavar_name.sgrep
│ │ ├── misc_at_interface.sgrep
│ │ ├── misc_precedence.sgrep
│ │ ├── misc_super_call.sgrep
│ │ ├── partial_method.sgrep
│ │ ├── anonymous_metavar.java
│ │ ├── cp_string_format.sgrep
│ │ ├── dots_params.sgrep
│ │ ├── dots_vardef.sgrep
│ │ ├── less_generics.sgrep
│ │ ├── metavar_import.sgrep
│ │ ├── metavar_package.sgrep
│ │ ├── metavar_typed.sgrep
│ │ ├── metavar_typed_localvar.sgrep
│ │ ├── misc_class_literal.sgrep
│ │ ├── misc_static_block.sgrep
│ │ ├── try_mutli_resources.sgrep
│ │ ├── visit_attribute.sgrep
│ │ ├── cp_is_must_analysis.sgrep
│ │ ├── cp_is_must_analysis1.sgrep
│ │ ├── cp_is_must_analysis2.sgrep
│ │ ├── dots_generics.sgrep
│ │ ├── dots_import.sgrep
│ │ ├── generics_args.sgrep
│ │ ├── import_metavar_fullpath.sgrep
│ │ ├── less_inheritance.sgrep
│ │ ├── metavar_typed_function.sgrep
│ │ ├── misc_accent_record.sgrep
│ │ ├── misc_constructor.sgrep
│ │ ├── misc_token_cast.sgrep
│ │ ├── partial_class_attr.sgrep
│ │ ├── aliasing_and_direct.sgrep
│ │ ├── dots_enum.sgrep
│ │ ├── equivalence_constant_propagation.sgrep
│ │ ├── errors
│ │ │ └── recoverable_error1.java
│ │ ├── metavar_typed_classfield.sgrep
│ │ ├── metavar_typed_field.sgrep
│ │ ├── metavar_typed_lefthand.sgrep
│ │ ├── misc_import_static.sgrep
│ │ ├── parameterized_type.sgrep
│ │ └── try_resources.sgrep
│ ├── cairo
│ │ ├── dots_args.sgrep
│ │ ├── metavar_let.sgrep
│ │ ├── dots_loop.sgrep
│ │ ├── metavar_stmt.sgrep
│ │ └── misc_impl.sgrep
│ ├── clojure
│ │ ├── concrete_syntax.sgrep
│ │ ├── dots_args.sgrep
│ │ ├── metavar_arg.sgrep
│ │ ├── metavar_call.sgrep
│ │ ├── dots_string.sgrep
│ │ └── metavar_slash_access.sgrep
│ ├── html
│ │ └── metavar_tag.sgrep
│ ├── json
│ │ ├── anonymous_metavar.json
│ │ ├── deep_expr_operator.sgrep
│ │ ├── partial_single_field.sgrep
│ │ ├── partial_single_field2.sgrep
│ │ └── metavar_array.sgrep
│ ├── move_on_aptos
│ │ ├── dots_string.sgrep
│ │ ├── misc_address_value.sgrep
│ │ ├── misc_vector_value.sgrep
│ │ └── deep_exprstmt.sgrep
│ ├── move_on_sui
│ │ ├── dots_string.sgrep
│ │ ├── deep_exprstmt.sgrep
│ │ ├── deep_expr_operator.sgrep
│ │ ├── metavar_anno.sgrep
│ │ └── metavar_import.sgrep
│ ├── r
│ │ └── anonymous_metavar.r
│ ├── dart
│ │ └── anonymous_metavar.dart
│ ├── hack
│ │ ├── TODO
│ │ │ └── equivalence_eq.sgrep
│ │ ├── anonymous_metavar.hack
│ │ ├── dots_params.sgrep
│ │ └── metavar_cond.sgrep
│ ├── solidity
│ │ ├── misc_enum.sgrep
│ │ ├── misc_event.sgrep
│ │ ├── anonymous_metavar.sol
│ │ ├── dots_contract.sgrep
│ │ └── misc_unchecked.sgrep
│ ├── xml
│ │ └── misc_attribute_pattern.sgrep
│ ├── circom
│ │ ├── anonymous_metavar.circom
│ │ └── metavar_version.sgrep
│ ├── jsonnet
│ │ ├── anonymous_metavar.jsonnet
│ │ └── deep_expr_operator.sgrep
│ ├── protobuf
│ │ └── simple.sgrep
│ └── terraform
│ │ └── deep_expr_operator.sgrep
├── rules
│ ├── rule_extensions.py
│ ├── inception.yl
│ ├── js_no_ts.yl
│ ├── inception2.yl
│ ├── skip_list.txt
│ ├── vardef_assign_false.js
│ ├── vardef_assign_false1.js
│ ├── vardef_assign_true.js
│ ├── vardef_assign_true1.js
│ ├── vardef_assign_true2.js
│ └── xml_metavar_comp2.xml
├── irrelevant_rules
│ ├── pattern.py
│ ├── mvar-regex1.txt
│ ├── pattern-regex.py
│ ├── mvar-regex2.go
│ ├── taint-general-source.py
│ ├── pattern-and.py
│ └── pattern-either.py
├── jsonnet
│ ├── pass
│ │ ├── basic.json
│ │ ├── closure.json
│ │ ├── closure2.json
│ │ ├── filter.json
│ │ ├── import.json
│ │ ├── inf.json
│ │ ├── length.json
│ │ ├── simple_self.json
│ │ ├── concat1.json
│ │ ├── concat2.json
│ │ ├── null_field.json
│ │ ├── render_int.json
│ │ ├── returning_self.json
│ │ ├── self_as_object.json
│ │ ├── string.json
│ │ ├── use_std.json
│ │ ├── adding_self_to_self.json
│ │ ├── extending_self_on_left.json
│ │ ├── extending_self_on_right.json
│ │ ├── nested_object_with_self.json
│ │ ├── objectHas.json
│ │ ├── simple_self_with_plus.json
│ │ ├── string.jsonnet
│ │ ├── string_access.json
│ │ ├── array_comprehension2.json
│ │ ├── basic.jsonnet
│ │ ├── function.json
│ │ ├── import_local.json
│ │ ├── object.json
│ │ ├── short_circuit_func.json
│ │ ├── concat1.jsonnet
│ │ ├── concat2.jsonnet
│ │ ├── obj_access.json
│ │ ├── self_access.json
│ │ ├── string_access.jsonnet
│ │ ├── inf.jsonnet
│ │ ├── locals_in_objects.json
│ │ ├── plus_object.json
│ │ ├── self_bound_correctly_in_superobjects.json
│ │ ├── simple_self.jsonnet
│ │ ├── foo.txt
│ │ ├── self_as_object.jsonnet
│ │ └── super_up_two_levels.json
│ ├── only_envir
│ │ ├── format.json
│ │ ├── format_percent.json
│ │ ├── format_string.json
│ │ ├── format_percent.jsonnet
│ │ └── format.jsonnet
│ ├── tutorial
│ │ └── pass
│ │ │ └── garnish.txt
│ ├── errors
│ │ ├── error2.jsonnet
│ │ ├── error1.jsonnet
│ │ └── floor_not_float.jsonnet
│ └── only_subst
│ │ └── basic_super.json
├── parsing
│ ├── lua
│ │ ├── one.lua
│ │ └── hello_world.lua
│ ├── ruby
│ │ └── string.rb
│ ├── bash
│ │ ├── hello.bash
│ │ ├── pipe-or.bash
│ │ ├── pipe-redirect.bash
│ │ └── and-cond.bash
│ ├── c
│ │ ├── char.c
│ │ └── basic.c
│ ├── cpp
│ │ └── char.cpp
│ ├── js
│ │ └── jsx.js
│ ├── ql
│ │ └── basic.ql
│ ├── r
│ │ └── hello-world.r
│ ├── csharp
│ │ └── extern_alias.cs
│ ├── dockerfile
│ │ ├── user.dockerfile
│ │ ├── numeric-user.dockerfile
│ │ └── no-trailing-newline.dockerfile
│ ├── jsonnet
│ │ ├── foo.jsonnet
│ │ └── string.jsonnet
│ ├── julia
│ │ └── helloworld.jl
│ ├── ocaml
│ │ ├── basic.mli
│ │ └── attribute_type.ml
│ ├── python
│ │ └── re.py
│ ├── scala
│ │ ├── fun_dcl.scala
│ │ ├── splatted_args.scala
│ │ └── using_args.scala
│ ├── swift
│ │ └── hello-world.swift
│ ├── kotlin
│ │ ├── string.kt
│ │ ├── binary-func.kt
│ │ └── small-program.kt
│ └── php
│ │ └── class.php
├── windows
│ ├── test.py
│ └── readme.txt
├── autofix
│ ├── js
│ │ ├── arrow_func.fix
│ │ ├── fix_obj.sgrep
│ │ ├── arrow_func.sgrep
│ │ ├── fix_obj.fix
│ │ ├── metavar_arg.fix
│ │ ├── metavar_call.fix
│ │ ├── fix_obj.js
│ │ └── fix_obj.fixed
│ ├── ocaml
│ │ ├── val.fix
│ │ ├── val.sgrep
│ │ ├── poly_paren_type.fix
│ │ ├── poly_paren_type.sgrep
│ │ ├── val.ml
│ │ └── val.fixed
│ ├── ts
│ │ ├── fix_cast.fix
│ │ └── fix_cast.sgrep
│ ├── cpp
│ │ ├── fix_vardef.fix
│ │ └── fix_vardef.sgrep
│ ├── csharp
│ │ ├── fix_vardef.fix
│ │ └── fix_vardef.sgrep
│ ├── dart
│ │ ├── fix_vardef.fix
│ │ └── fix_vardef.sgrep
│ ├── java
│ │ ├── fix_vardef.fix
│ │ └── fix_vardef.sgrep
│ ├── python
│ │ ├── fix_binop.sgrep
│ │ ├── regexp_count.sgrep
│ │ ├── simple_regexp.sgrep
│ │ ├── aligned_fix.fix
│ │ ├── aligned_fix.sgrep
│ │ ├── capture_group.sgrep
│ │ ├── fix_binop.fix
│ │ ├── fix_within_binop.sgrep
│ │ ├── metavar_call.fix
│ │ ├── metavar_string2.sgrep
│ │ ├── regexp_overcount.sgrep
│ │ ├── fix_within_binop.fix
│ │ ├── metavar_string2.fix
│ │ ├── aligned_fix.py
│ │ ├── aligned_fix_non_ast.sgrep
│ │ ├── capture_group.py
│ │ ├── fix_dotted_ident.fix
│ │ ├── aligned_fix_non_ast.fix
│ │ ├── capture_group.fixed
│ │ ├── fix_dotted_ident.sgrep
│ │ ├── regexp_count.fix-regex
│ │ ├── simple_regexp.fix-regex
│ │ ├── aligned_fix.fixed
│ │ ├── aligned_fix_non_ast.py
│ │ └── regexp_overcount.fix-regex
│ ├── rust
│ │ ├── fix_vardef.fix
│ │ └── fix_vardef.sgrep
│ ├── cairo
│ │ ├── fix_vardef.fix
│ │ └── fix_vardef.sgrep
│ └── solidity
│ │ ├── fix_vardef.fix
│ │ └── fix_vardef.sgrep
├── parsing_patterns
│ └── java
│ │ ├── import.java
│ │ ├── import.sgrep
│ │ └── package.sgrep
├── parsing_errors
│ ├── unbalanced_brace.py
│ └── err.ts
├── snapshots
│ └── semgrep-core
│ │ ├── 8128ddf1251b
│ │ └── stdout
│ │ └── 2e75b85cd1f4
│ │ └── name
└── login
│ └── bad_response.json
├── .github
└── pull_request_template.md
├── bin
├── scripts
└── release
│ └── git
│ └── __init__.py
├── src
├── spacegrep
│ ├── bin
│ │ └── spacecat
│ ├── examples
│ │ ├── exec.pat
│ │ ├── python-tab.pat
│ │ ├── python-from.pat
│ │ ├── js-optional-chain.pat
│ │ ├── ruby-erb.pat
│ │ ├── my_first_calculator.py.pat
│ │ ├── go-package.pat
│ │ ├── go-package.url
│ │ ├── hello.pat
│ │ └── js-optional-chain.doc
│ ├── .gitignore
│ └── src
│ │ └── test
│ │ └── .ocamlformat-ignore
├── osemgrep
│ ├── cli_ci
│ │ └── Unit_ci.mli
│ └── reporting
│ │ └── Gated_data.ml
├── parsing
│ └── Parsing_stats.atd
├── configuring
│ └── Rule_options.atd
├── lsp
│ └── Unit_LS.mli
├── rule
│ ├── Language.ml
│ └── Language.mli
└── fixing
│ └── tests
│ └── Unit_autofix_printer.mli
├── test
├── TCB
└── CapStdlib.ml
├── languages
├── python
│ └── menhir
│ │ └── Flag_parsing_python.ml
└── regexp
│ └── .gitignore
├── stats
├── autofix-printing-stats
│ └── .gitignore
└── parsing-stats
│ └── test-parsing
│ └── .gitignore
├── perf
└── bench
│ └── dummy
│ ├── targets
│ ├── hello.js
│ └── malformed.js
│ └── input
│ └── dummy
│ └── targets
│ └── hello.js
├── libs
├── murmur3
│ └── Murmur3.mli
├── commons
│ └── tests
│ │ └── Unit_Result_.mli
├── parallelism
│ └── tests
│ │ └── Parallelism_tests.mli
├── profiling
│ └── ppx
│ │ └── tests
│ │ ├── basic.ml
│ │ └── label.ml
└── tracing
│ └── ppx
│ └── ppx_tests
│ └── label.ml
└── interfaces
└── semgrep_interfaces
/cli/LICENSE:
--------------------------------------------------------------------------------
1 | ../LICENSE
--------------------------------------------------------------------------------
/cli/tests/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/src/semdep/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/stubs/ruamel/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/tests/qa/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/TODO/basic.sgrep:
--------------------------------------------------------------------------------
1 | foo()
--------------------------------------------------------------------------------
/tests/misc/otarzan/poly.ml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/misc/otarzan/record.ml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/misc/otarzan/stmt.ml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/perf/eq.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/bin:
--------------------------------------------------------------------------------
1 | _build/install/default/bin
--------------------------------------------------------------------------------
/cli/src/semgrep/app/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/stubs/boltons/deprutils.pyi:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/stubs/boltons/easterutils.pyi:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/stubs/boltons/excutils.pyi:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/stubs/boltons/mboxutils.pyi:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/stubs/boltons/typeutils.pyi:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/stubs/packaging/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/scripts/release/git/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/TODO/metavar.sgrep:
--------------------------------------------------------------------------------
1 | foo($X)
--------------------------------------------------------------------------------
/tests/TODO/string.sgrep:
--------------------------------------------------------------------------------
1 | "..."
2 |
--------------------------------------------------------------------------------
/tests/TODO/unify.sgrep:
--------------------------------------------------------------------------------
1 | $X != $X
--------------------------------------------------------------------------------
/tests/patterns/bash/empty.bash:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/patterns/bash/empty.sgrep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/patterns/yaml/empty.yaml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/rules/rule_extensions.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/src/semdep/external/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/src/semdep/matchers/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/src/semdep/parsers/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/src/semgrep/commands/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/src/semgrep/external/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/src/semgrep/formatter/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/spacegrep/bin/spacecat:
--------------------------------------------------------------------------------
1 | spacegrep
--------------------------------------------------------------------------------
/test:
--------------------------------------------------------------------------------
1 | _build/default/src/tests/test.exe
--------------------------------------------------------------------------------
/tests/TODO/global.py:
--------------------------------------------------------------------------------
1 | myglobal = 1
2 |
--------------------------------------------------------------------------------
/tests/irrelevant_rules/pattern.py:
--------------------------------------------------------------------------------
1 | shell
--------------------------------------------------------------------------------
/tests/jsonnet/pass/basic.json:
--------------------------------------------------------------------------------
1 | [3,42]
--------------------------------------------------------------------------------
/tests/jsonnet/pass/closure.json:
--------------------------------------------------------------------------------
1 | 5
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/closure2.json:
--------------------------------------------------------------------------------
1 | 6
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/filter.json:
--------------------------------------------------------------------------------
1 | [2,3]
--------------------------------------------------------------------------------
/tests/jsonnet/pass/import.json:
--------------------------------------------------------------------------------
1 | [[3,42]]
--------------------------------------------------------------------------------
/tests/jsonnet/pass/inf.json:
--------------------------------------------------------------------------------
1 | false
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/length.json:
--------------------------------------------------------------------------------
1 | [2,2,3]
--------------------------------------------------------------------------------
/tests/jsonnet/pass/simple_self.json:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/tests/parsing/lua/one.lua:
--------------------------------------------------------------------------------
1 | return 1
2 |
--------------------------------------------------------------------------------
/tests/patterns/generic/minified.sgrep:
--------------------------------------------------------------------------------
1 | a
--------------------------------------------------------------------------------
/tests/patterns/go/cp_ref.sgrep:
--------------------------------------------------------------------------------
1 | &0
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/opt_chain.sgrep:
--------------------------------------------------------------------------------
1 | x?.y
--------------------------------------------------------------------------------
/tests/patterns/yaml/empty.sgrep:
--------------------------------------------------------------------------------
1 | $X
2 |
--------------------------------------------------------------------------------
/tests/rules/inception.yl:
--------------------------------------------------------------------------------
1 | inception.yaml
--------------------------------------------------------------------------------
/tests/rules/js_no_ts.yl:
--------------------------------------------------------------------------------
1 | js_no_ts.yaml
--------------------------------------------------------------------------------
/tests/windows/test.py:
--------------------------------------------------------------------------------
1 | print("foo")
2 |
--------------------------------------------------------------------------------
/cli/src/semdep/external/packaging/py.typed:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/src/semgrep/console_scripts/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/tests/default/consistency/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/TODO/name_metavar.sgrep:
--------------------------------------------------------------------------------
1 | import $X
2 |
--------------------------------------------------------------------------------
/tests/TODO/stmt_basic.sgrep:
--------------------------------------------------------------------------------
1 | import foo
2 |
--------------------------------------------------------------------------------
/tests/autofix/js/arrow_func.fix:
--------------------------------------------------------------------------------
1 | bar($X)
2 |
--------------------------------------------------------------------------------
/tests/autofix/js/fix_obj.sgrep:
--------------------------------------------------------------------------------
1 | foo()
2 |
--------------------------------------------------------------------------------
/tests/autofix/ocaml/val.fix:
--------------------------------------------------------------------------------
1 | val foo : float
--------------------------------------------------------------------------------
/tests/autofix/ts/fix_cast.fix:
--------------------------------------------------------------------------------
1 | 2 + $X
2 |
--------------------------------------------------------------------------------
/tests/autofix/ts/fix_cast.sgrep:
--------------------------------------------------------------------------------
1 | 1 + $X
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/concat1.json:
--------------------------------------------------------------------------------
1 | ["foobar"]
--------------------------------------------------------------------------------
/tests/jsonnet/pass/concat2.json:
--------------------------------------------------------------------------------
1 | ["foo[1,2]"]
--------------------------------------------------------------------------------
/tests/jsonnet/pass/null_field.json:
--------------------------------------------------------------------------------
1 | {"foo":1}
--------------------------------------------------------------------------------
/tests/jsonnet/pass/render_int.json:
--------------------------------------------------------------------------------
1 | "-0"
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/returning_self.json:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/tests/jsonnet/pass/self_as_object.json:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/tests/jsonnet/pass/string.json:
--------------------------------------------------------------------------------
1 | ["foobar"]
--------------------------------------------------------------------------------
/tests/jsonnet/pass/use_std.json:
--------------------------------------------------------------------------------
1 | [3,10,2]
--------------------------------------------------------------------------------
/tests/parsing/ruby/string.rb:
--------------------------------------------------------------------------------
1 | a = "foo"
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/assign.sgrep:
--------------------------------------------------------------------------------
1 | a=...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/concatenation.sgrep:
--------------------------------------------------------------------------------
1 | a'b'
--------------------------------------------------------------------------------
/tests/patterns/bash/not.sgrep:
--------------------------------------------------------------------------------
1 | ! ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/or.sgrep:
--------------------------------------------------------------------------------
1 | ... || ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/cp_exception.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
--------------------------------------------------------------------------------
/tests/patterns/generic/not-minified.sgrep:
--------------------------------------------------------------------------------
1 | a
--------------------------------------------------------------------------------
/tests/patterns/go/imports2.sgrep:
--------------------------------------------------------------------------------
1 | import "$X"
--------------------------------------------------------------------------------
/tests/patterns/go/struct_tags.sgrep:
--------------------------------------------------------------------------------
1 | `...`
--------------------------------------------------------------------------------
/tests/patterns/js/eval_call.sgrep:
--------------------------------------------------------------------------------
1 | $F(x)
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/foo.sgrep:
--------------------------------------------------------------------------------
1 | foo($X)
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/misc_goto.sgrep:
--------------------------------------------------------------------------------
1 | goto $X;
--------------------------------------------------------------------------------
/tests/patterns/ruby/blocks.sgrep:
--------------------------------------------------------------------------------
1 | f($X)
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/dots_regexp.sgrep:
--------------------------------------------------------------------------------
1 | /.../
--------------------------------------------------------------------------------
/tests/patterns/swift/match_name.sgrep:
--------------------------------------------------------------------------------
1 | foo
--------------------------------------------------------------------------------
/tests/rules/inception2.yl:
--------------------------------------------------------------------------------
1 | inception2.yaml
--------------------------------------------------------------------------------
/TCB/CapStdlib.ml:
--------------------------------------------------------------------------------
1 | let exit _cap = Stdlib.exit
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e-other/rules:
--------------------------------------------------------------------------------
1 | ../e2e/rules
--------------------------------------------------------------------------------
/cli/tests/default/e2e/rules/syntax/empty.yaml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/languages/python/menhir/Flag_parsing_python.ml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/spacegrep/examples/exec.pat:
--------------------------------------------------------------------------------
1 | exec(...)
2 |
--------------------------------------------------------------------------------
/src/spacegrep/examples/python-tab.pat:
--------------------------------------------------------------------------------
1 | $X
2 |
--------------------------------------------------------------------------------
/stats/autofix-printing-stats/.gitignore:
--------------------------------------------------------------------------------
1 | tmp
2 |
--------------------------------------------------------------------------------
/tests/TODO/bad.py:
--------------------------------------------------------------------------------
1 | def foo
2 | return 1
3 |
--------------------------------------------------------------------------------
/tests/TODO/dots.sgrep:
--------------------------------------------------------------------------------
1 | foo($X, ...);
2 |
3 |
--------------------------------------------------------------------------------
/tests/autofix/cpp/fix_vardef.fix:
--------------------------------------------------------------------------------
1 | int bar = $V;
--------------------------------------------------------------------------------
/tests/autofix/csharp/fix_vardef.fix:
--------------------------------------------------------------------------------
1 | int bar = $V;
--------------------------------------------------------------------------------
/tests/autofix/dart/fix_vardef.fix:
--------------------------------------------------------------------------------
1 | int bar = $V;
--------------------------------------------------------------------------------
/tests/autofix/java/fix_vardef.fix:
--------------------------------------------------------------------------------
1 | int bar = $V;
--------------------------------------------------------------------------------
/tests/autofix/js/arrow_func.sgrep:
--------------------------------------------------------------------------------
1 | foo($X)
2 |
--------------------------------------------------------------------------------
/tests/autofix/js/fix_obj.fix:
--------------------------------------------------------------------------------
1 | foo({x: true})
2 |
--------------------------------------------------------------------------------
/tests/autofix/js/metavar_arg.fix:
--------------------------------------------------------------------------------
1 | bar($X, 4)
2 |
--------------------------------------------------------------------------------
/tests/autofix/js/metavar_call.fix:
--------------------------------------------------------------------------------
1 | $F(2,1)
2 |
--------------------------------------------------------------------------------
/tests/autofix/ocaml/val.sgrep:
--------------------------------------------------------------------------------
1 | val foo: int
2 |
--------------------------------------------------------------------------------
/tests/autofix/python/fix_binop.sgrep:
--------------------------------------------------------------------------------
1 | foo($X)
2 |
--------------------------------------------------------------------------------
/tests/autofix/python/regexp_count.sgrep:
--------------------------------------------------------------------------------
1 | foo($A)
--------------------------------------------------------------------------------
/tests/autofix/python/simple_regexp.sgrep:
--------------------------------------------------------------------------------
1 | foo($A)
--------------------------------------------------------------------------------
/tests/irrelevant_rules/mvar-regex1.txt:
--------------------------------------------------------------------------------
1 | foo
2 |
--------------------------------------------------------------------------------
/tests/irrelevant_rules/pattern-regex.py:
--------------------------------------------------------------------------------
1 | hello
--------------------------------------------------------------------------------
/tests/jsonnet/pass/adding_self_to_self.json:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/tests/jsonnet/pass/extending_self_on_left.json:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/tests/jsonnet/pass/extending_self_on_right.json:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/tests/jsonnet/pass/nested_object_with_self.json:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/tests/jsonnet/pass/objectHas.json:
--------------------------------------------------------------------------------
1 | [true,false]
--------------------------------------------------------------------------------
/tests/jsonnet/pass/simple_self_with_plus.json:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/tests/jsonnet/pass/string.jsonnet:
--------------------------------------------------------------------------------
1 | ["foobar"]
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/string_access.json:
--------------------------------------------------------------------------------
1 | "f"
2 |
--------------------------------------------------------------------------------
/tests/misc/il/var.py:
--------------------------------------------------------------------------------
1 | def foo():
2 | a = 1
3 |
--------------------------------------------------------------------------------
/tests/parsing/bash/hello.bash:
--------------------------------------------------------------------------------
1 | echo hello
2 |
--------------------------------------------------------------------------------
/tests/parsing/bash/pipe-or.bash:
--------------------------------------------------------------------------------
1 | a | b || c
2 |
--------------------------------------------------------------------------------
/tests/parsing/c/char.c:
--------------------------------------------------------------------------------
1 | char grade = 'D';
2 |
--------------------------------------------------------------------------------
/tests/parsing/cpp/char.cpp:
--------------------------------------------------------------------------------
1 | char grade = 'D';
2 |
--------------------------------------------------------------------------------
/tests/parsing/js/jsx.js:
--------------------------------------------------------------------------------
1 | return text;
2 |
--------------------------------------------------------------------------------
/tests/parsing/ql/basic.ql:
--------------------------------------------------------------------------------
1 | from Int x
2 | select x
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/dots_expr.sgrep:
--------------------------------------------------------------------------------
1 | $X = ...
--------------------------------------------------------------------------------
/tests/patterns/bash/assign-add.sgrep:
--------------------------------------------------------------------------------
1 | a+=...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/background.sgrep:
--------------------------------------------------------------------------------
1 | ... &
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/case-body.sgrep:
--------------------------------------------------------------------------------
1 | echo ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/expression.sgrep:
--------------------------------------------------------------------------------
1 | foo
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/for-body.sgrep:
--------------------------------------------------------------------------------
1 | echo ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/hello.sgrep:
--------------------------------------------------------------------------------
1 | echo ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/if-body.sgrep:
--------------------------------------------------------------------------------
1 | echo ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/if-header.sgrep:
--------------------------------------------------------------------------------
1 | echo ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/match-cmd-or-arg.sgrep:
--------------------------------------------------------------------------------
1 | a
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/subshell.sgrep:
--------------------------------------------------------------------------------
1 | (...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/todo/deep_exprstmt.sgrep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/patterns/cpp/block_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | { ... }
--------------------------------------------------------------------------------
/tests/patterns/cpp/standalone_expr.sgrep:
--------------------------------------------------------------------------------
1 | foo(...)
--------------------------------------------------------------------------------
/tests/patterns/cpp/toplevel_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | ...
--------------------------------------------------------------------------------
/tests/patterns/cpp/typed_metavar.sgrep:
--------------------------------------------------------------------------------
1 | (int $X)
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/arg.sgrep:
--------------------------------------------------------------------------------
1 | ARG a=42
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/run.sgrep:
--------------------------------------------------------------------------------
1 | RUN ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/imports.sgrep:
--------------------------------------------------------------------------------
1 | import "foo/bar"
--------------------------------------------------------------------------------
/tests/patterns/go/metavar_expr.sgrep:
--------------------------------------------------------------------------------
1 | $IDENT
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/cp_incrdecr.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_regexp.sgrep:
--------------------------------------------------------------------------------
1 | /.../
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_arrow.sgrep:
--------------------------------------------------------------------------------
1 | (a) => { ... }
--------------------------------------------------------------------------------
/tests/patterns/js/misc_new.sgrep:
--------------------------------------------------------------------------------
1 | new $A(1)
2 |
--------------------------------------------------------------------------------
/tests/patterns/julia/op_plus.sgrep:
--------------------------------------------------------------------------------
1 | $A+$B
2 |
--------------------------------------------------------------------------------
/tests/patterns/julia/using_import.sgrep:
--------------------------------------------------------------------------------
1 | using $X
--------------------------------------------------------------------------------
/tests/patterns/kotlin/string_metavar.sgrep:
--------------------------------------------------------------------------------
1 | "$X"
--------------------------------------------------------------------------------
/tests/patterns/lua/assignment.sgrep:
--------------------------------------------------------------------------------
1 | $X = $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/lua/comparison.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/foo.sgrep:
--------------------------------------------------------------------------------
1 | Pervasives.$X
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/dots_echo.sgrep:
--------------------------------------------------------------------------------
1 | echo ...;
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/dots_eval.sgrep:
--------------------------------------------------------------------------------
1 | eval(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/gh_5880.sgrep:
--------------------------------------------------------------------------------
1 | die(...);
2 |
--------------------------------------------------------------------------------
/tests/patterns/promql/func.sgrep:
--------------------------------------------------------------------------------
1 | $F(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_label.sgrep:
--------------------------------------------------------------------------------
1 | "foo"
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_rlval.sgrep:
--------------------------------------------------------------------------------
1 | "foo"
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/dots_list.sgrep:
--------------------------------------------------------------------------------
1 | [...]
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/index_tuple.sgrep:
--------------------------------------------------------------------------------
1 | 1, 2
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/parenthesized_with.sgrep:
--------------------------------------------------------------------------------
1 | 1
--------------------------------------------------------------------------------
/tests/patterns/python/scoped_wildcard.sgrep:
--------------------------------------------------------------------------------
1 | A.x
--------------------------------------------------------------------------------
/tests/patterns/ql/metavar_anno.sgrep:
--------------------------------------------------------------------------------
1 | foo[$Y]($Z)
--------------------------------------------------------------------------------
/tests/patterns/ruby/blocks1.sgrep:
--------------------------------------------------------------------------------
1 | f($X, $Y)
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/dots_atom.sgrep:
--------------------------------------------------------------------------------
1 | :...
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/foo.sgrep:
--------------------------------------------------------------------------------
1 | puts "..."
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_div0.sgrep:
--------------------------------------------------------------------------------
1 | $X / 0
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_dot_call.sgrep:
--------------------------------------------------------------------------------
1 | $FOO
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_parsing1.sgrep:
--------------------------------------------------------------------------------
1 | FOO
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_parsing2.sgrep:
--------------------------------------------------------------------------------
1 | $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/regexp_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | /.../
--------------------------------------------------------------------------------
/tests/patterns/ruby/regexp_literal.sgrep:
--------------------------------------------------------------------------------
1 | /a/
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/metavar_standalone.sgrep:
--------------------------------------------------------------------------------
1 | $X
--------------------------------------------------------------------------------
/tests/patterns/rust/misc_return_3.sgrep:
--------------------------------------------------------------------------------
1 | 3
2 |
--------------------------------------------------------------------------------
/tests/patterns/scala/metavar_atom.sgrep:
--------------------------------------------------------------------------------
1 | '$X
2 |
--------------------------------------------------------------------------------
/tests/patterns/scala/misc_symbol.sgrep:
--------------------------------------------------------------------------------
1 | 'Foo
2 |
--------------------------------------------------------------------------------
/tests/patterns/swift/typed_metavar.sgrep:
--------------------------------------------------------------------------------
1 | ($X : t)
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_ast.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e-other/targets:
--------------------------------------------------------------------------------
1 | ../e2e/targets
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/ignores/.gitignore:
--------------------------------------------------------------------------------
1 | bad/
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/pro-rule-skipping/x.cls:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/spacegrep/examples/python-from.pat:
--------------------------------------------------------------------------------
1 | $X = 0
2 |
--------------------------------------------------------------------------------
/tests/TODO/stmt_metavar.sgrep:
--------------------------------------------------------------------------------
1 | if $X:
2 | $Y
3 |
--------------------------------------------------------------------------------
/tests/autofix/cpp/fix_vardef.sgrep:
--------------------------------------------------------------------------------
1 | int foo = $V;
2 |
--------------------------------------------------------------------------------
/tests/autofix/dart/fix_vardef.sgrep:
--------------------------------------------------------------------------------
1 | int foo = $V;
2 |
--------------------------------------------------------------------------------
/tests/autofix/java/fix_vardef.sgrep:
--------------------------------------------------------------------------------
1 | int foo = $V;
2 |
--------------------------------------------------------------------------------
/tests/autofix/js/fix_obj.js:
--------------------------------------------------------------------------------
1 | // MATCH:
2 | foo();
3 |
--------------------------------------------------------------------------------
/tests/autofix/ocaml/poly_paren_type.fix:
--------------------------------------------------------------------------------
1 | val bar : $X
--------------------------------------------------------------------------------
/tests/autofix/ocaml/poly_paren_type.sgrep:
--------------------------------------------------------------------------------
1 | val foo : $X
--------------------------------------------------------------------------------
/tests/autofix/python/aligned_fix.fix:
--------------------------------------------------------------------------------
1 | foo()
2 | bar()
--------------------------------------------------------------------------------
/tests/autofix/python/aligned_fix.sgrep:
--------------------------------------------------------------------------------
1 | to_replace(...)
--------------------------------------------------------------------------------
/tests/autofix/python/capture_group.sgrep:
--------------------------------------------------------------------------------
1 | f($X)
2 |
--------------------------------------------------------------------------------
/tests/autofix/python/fix_binop.fix:
--------------------------------------------------------------------------------
1 | bar($X * 2)
2 |
--------------------------------------------------------------------------------
/tests/autofix/python/fix_within_binop.sgrep:
--------------------------------------------------------------------------------
1 | foo()
2 |
--------------------------------------------------------------------------------
/tests/autofix/python/metavar_call.fix:
--------------------------------------------------------------------------------
1 | $F(2, 1)
2 |
--------------------------------------------------------------------------------
/tests/autofix/python/metavar_string2.sgrep:
--------------------------------------------------------------------------------
1 | foo("$VAR")
--------------------------------------------------------------------------------
/tests/autofix/python/regexp_overcount.sgrep:
--------------------------------------------------------------------------------
1 | foo($A)
--------------------------------------------------------------------------------
/tests/autofix/rust/fix_vardef.fix:
--------------------------------------------------------------------------------
1 | const bar : int;
--------------------------------------------------------------------------------
/tests/jsonnet/only_envir/format.json:
--------------------------------------------------------------------------------
1 | "hello 12"
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/array_comprehension2.json:
--------------------------------------------------------------------------------
1 | [2,3,4]
--------------------------------------------------------------------------------
/tests/jsonnet/pass/basic.jsonnet:
--------------------------------------------------------------------------------
1 | [1+2, 42]
2 |
3 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/function.json:
--------------------------------------------------------------------------------
1 | {"foo":3,"bar":42}
--------------------------------------------------------------------------------
/tests/jsonnet/pass/import_local.json:
--------------------------------------------------------------------------------
1 | {"bar":1}
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/object.json:
--------------------------------------------------------------------------------
1 | {"foo":1,"bar":"str"}
--------------------------------------------------------------------------------
/tests/jsonnet/pass/short_circuit_func.json:
--------------------------------------------------------------------------------
1 | [false]
--------------------------------------------------------------------------------
/tests/parsing/bash/pipe-redirect.bash:
--------------------------------------------------------------------------------
1 | a | b > c
2 |
--------------------------------------------------------------------------------
/tests/parsing/r/hello-world.r:
--------------------------------------------------------------------------------
1 | print("Hello world!")
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/anonymous_metavar.sgrep:
--------------------------------------------------------------------------------
1 | $_
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/dots_args.sgrep:
--------------------------------------------------------------------------------
1 | foo(..., 5)
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/dots_string.sgrep:
--------------------------------------------------------------------------------
1 | foo("...")
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/metavar_arg.sgrep:
--------------------------------------------------------------------------------
1 | foo($X, 2)
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/metavar_call.sgrep:
--------------------------------------------------------------------------------
1 | $F(1,2)
--------------------------------------------------------------------------------
/tests/patterns/bash/added_identifier.sh:
--------------------------------------------------------------------------------
1 | echo hello
--------------------------------------------------------------------------------
/tests/patterns/bash/anchored-stmt.sgrep:
--------------------------------------------------------------------------------
1 | { a; }
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/array-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | ar=(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/concrete_syntax.sgrep:
--------------------------------------------------------------------------------
1 | foo bar
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/dots_args.sgrep:
--------------------------------------------------------------------------------
1 | foo ... 5
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/dots_string.sgrep:
--------------------------------------------------------------------------------
1 | foo "..."
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/function-body.sgrep:
--------------------------------------------------------------------------------
1 | echo ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/metavar_arg.sgrep:
--------------------------------------------------------------------------------
1 | foo $X 2
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/not-an-expression1.sgrep:
--------------------------------------------------------------------------------
1 | foo;
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/pipeline.sgrep:
--------------------------------------------------------------------------------
1 | ... | echo ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/quoted-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | "..."
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/quoted-expansion.sgrep:
--------------------------------------------------------------------------------
1 | "$X"
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/select-body.sgrep:
--------------------------------------------------------------------------------
1 | echo ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/set-lhs-metavar.sgrep:
--------------------------------------------------------------------------------
1 | $X=42
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/stmt-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | a; ...; b
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/todo/assign-multi.sgrep:
--------------------------------------------------------------------------------
1 | a=...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/while-body.sgrep:
--------------------------------------------------------------------------------
1 | echo ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/c/dots_sizeof.sgrep:
--------------------------------------------------------------------------------
1 | sizeof(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/c/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | #include $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/cpp/named_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | foo($...X)
--------------------------------------------------------------------------------
/tests/patterns/csharp/concrete_syntax.sgrep:
--------------------------------------------------------------------------------
1 | Foo(1, 2)
--------------------------------------------------------------------------------
/tests/patterns/csharp/dots_args.sgrep:
--------------------------------------------------------------------------------
1 | Foo(..., 5)
2 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/loops.sgrep:
--------------------------------------------------------------------------------
1 | while($COND) { ... }
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | using $X;
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/expose.sgrep:
--------------------------------------------------------------------------------
1 | EXPOSE 42
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/from.sgrep:
--------------------------------------------------------------------------------
1 | FROM debian
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/user.sgrep:
--------------------------------------------------------------------------------
1 | USER root
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/imports3.sgrep:
--------------------------------------------------------------------------------
1 | import "foobar"
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/imports_prefix.sgrep:
--------------------------------------------------------------------------------
1 | import "foo"
--------------------------------------------------------------------------------
/tests/patterns/go/misc_noteq.sgrep:
--------------------------------------------------------------------------------
1 | $X != nil;
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/string_literals.sgrep:
--------------------------------------------------------------------------------
1 | "hello"
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/struct_tags_one.sgrep:
--------------------------------------------------------------------------------
1 | `json:"name"`
--------------------------------------------------------------------------------
/tests/patterns/go/typing-make.sgrep:
--------------------------------------------------------------------------------
1 | ($X : a).$M()
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/better_import1.sgrep:
--------------------------------------------------------------------------------
1 | A.foo(...)
--------------------------------------------------------------------------------
/tests/patterns/java/better_import2.sgrep:
--------------------------------------------------------------------------------
1 | A.B.foo(...)
--------------------------------------------------------------------------------
/tests/patterns/java/better_import3.sgrep:
--------------------------------------------------------------------------------
1 | A.B.foo(...)
--------------------------------------------------------------------------------
/tests/patterns/java/cp_foreach.sgrep:
--------------------------------------------------------------------------------
1 | $X != $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/cp_try_return.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_annot.sgrep:
--------------------------------------------------------------------------------
1 | @Attr($ARG)
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_assert.sgrep:
--------------------------------------------------------------------------------
1 | assert $X;
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/cp_array_destructure.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
--------------------------------------------------------------------------------
/tests/patterns/js/cp_label.sgrep:
--------------------------------------------------------------------------------
1 | "=~/http:///"
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/cp_throw.sgrep:
--------------------------------------------------------------------------------
1 | return "..."
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_container.sgrep:
--------------------------------------------------------------------------------
1 | var $X = [...];
--------------------------------------------------------------------------------
/tests/patterns/js/misc_null_cast.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_string.sgrep:
--------------------------------------------------------------------------------
1 | foo("bar")
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_unicode.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/regexp.sgrep:
--------------------------------------------------------------------------------
1 | const x = /.../;
2 |
--------------------------------------------------------------------------------
/tests/patterns/julia/import_import.sgrep:
--------------------------------------------------------------------------------
1 | import $X
--------------------------------------------------------------------------------
/tests/patterns/julia/using_alias.sgrep:
--------------------------------------------------------------------------------
1 | using $X as $Y
--------------------------------------------------------------------------------
/tests/patterns/kotlin/in_class_typing.sgrep:
--------------------------------------------------------------------------------
1 | foo(5)
--------------------------------------------------------------------------------
/tests/patterns/ocaml/dots_args.sgrep:
--------------------------------------------------------------------------------
1 | foo ... 5
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/dots_string.sgrep:
--------------------------------------------------------------------------------
1 | foo "..."
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/local_open.sgrep:
--------------------------------------------------------------------------------
1 | Foo.bar ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/metavar_arg.sgrep:
--------------------------------------------------------------------------------
1 | foo $X 2
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/metavar_call.sgrep:
--------------------------------------------------------------------------------
1 | $F 1 2
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/misc_notokenloc.sgrep:
--------------------------------------------------------------------------------
1 | $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/partial_if.sgrep:
--------------------------------------------------------------------------------
1 | if $X = $Y
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/partial_match.sgrep:
--------------------------------------------------------------------------------
1 | match $E
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/partial_try.sgrep:
--------------------------------------------------------------------------------
1 | try $BODY
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/regexp.sgrep:
--------------------------------------------------------------------------------
1 | "=~/.*\/tmp/"
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/cp_builtin.sgrep:
--------------------------------------------------------------------------------
1 | exec("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/cp_global.sgrep:
--------------------------------------------------------------------------------
1 | exec("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/cp_import.sgrep:
--------------------------------------------------------------------------------
1 | include("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/dots_backquote.sgrep:
--------------------------------------------------------------------------------
1 | `...`;
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/dots_include.sgrep:
--------------------------------------------------------------------------------
1 | include ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/sgrep/foo_expr.sgrep:
--------------------------------------------------------------------------------
1 | foo()
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/spatch/errors/missing_paren.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/patterns/python/concrete_fstring.sgrep:
--------------------------------------------------------------------------------
1 | foo
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_concat.sgrep:
--------------------------------------------------------------------------------
1 | "password"
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_exception.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_label1.sgrep:
--------------------------------------------------------------------------------
1 | $X["foo"]
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_with.sgrep:
--------------------------------------------------------------------------------
1 | print("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_yield.sgrep:
--------------------------------------------------------------------------------
1 | yield 42
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/dots_fstring.sgrep:
--------------------------------------------------------------------------------
1 | f"..."
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/imports.sgrep:
--------------------------------------------------------------------------------
1 | import foo.bar
--------------------------------------------------------------------------------
/tests/patterns/python/metavar_tuple.sgrep:
--------------------------------------------------------------------------------
1 | x = $T
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/misc_faketok3.sgrep:
--------------------------------------------------------------------------------
1 | [...]
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/misc_match_stmt.sgrep:
--------------------------------------------------------------------------------
1 | print(...)
--------------------------------------------------------------------------------
/tests/patterns/python/python2.sgrep:
--------------------------------------------------------------------------------
1 | $FOO(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/set_vs_dict.sgrep:
--------------------------------------------------------------------------------
1 | { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/wildcard_qualified.sgrep:
--------------------------------------------------------------------------------
1 | A.x
--------------------------------------------------------------------------------
/tests/patterns/ql/metavar_equality_expr.sgrep:
--------------------------------------------------------------------------------
1 | $X = $X
--------------------------------------------------------------------------------
/tests/patterns/ruby/call_expr_property.sgrep:
--------------------------------------------------------------------------------
1 | foo.$X()
--------------------------------------------------------------------------------
/tests/patterns/ruby/cp_assign.sgrep:
--------------------------------------------------------------------------------
1 | foo("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/cp_concat.sgrep:
--------------------------------------------------------------------------------
1 | test("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/metavar_interpolated.sgrep:
--------------------------------------------------------------------------------
1 | $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_backticks.sgrep:
--------------------------------------------------------------------------------
1 | `...`
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_bitand.sgrep:
--------------------------------------------------------------------------------
1 | $A & $B
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_range.sgrep:
--------------------------------------------------------------------------------
1 | ($X .. $Y)
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/regexp_metavar.sgrep:
--------------------------------------------------------------------------------
1 | /$V/
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/regexp_template.sgrep:
--------------------------------------------------------------------------------
1 | /.../
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | use $X;
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/misc_macrocall.sgrep:
--------------------------------------------------------------------------------
1 | $F(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/misc_scoped_idents.sgrep:
--------------------------------------------------------------------------------
1 | A::$X
--------------------------------------------------------------------------------
/tests/patterns/scala/apply_as_new.sgrep:
--------------------------------------------------------------------------------
1 | new $NAME()
--------------------------------------------------------------------------------
/tests/patterns/scala/dots_atom.sgrep:
--------------------------------------------------------------------------------
1 | '...
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/scala/infix_method.sgrep:
--------------------------------------------------------------------------------
1 | $XS.map($F)
--------------------------------------------------------------------------------
/tests/patterns/scala/metavar_typed.sgrep:
--------------------------------------------------------------------------------
1 | foo($X : Int)
--------------------------------------------------------------------------------
/tests/patterns/scala/pat_def.sgrep:
--------------------------------------------------------------------------------
1 | val List(...) = ...
--------------------------------------------------------------------------------
/tests/patterns/scala/tuple_def.sgrep:
--------------------------------------------------------------------------------
1 | val ($A,$B) = ...
--------------------------------------------------------------------------------
/tests/patterns/swift/if_let.sgrep:
--------------------------------------------------------------------------------
1 | if let foo = bar { }
--------------------------------------------------------------------------------
/tests/patterns/swift/keypath.sgrep:
--------------------------------------------------------------------------------
1 | \$X.isRecent
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_method.sgrep:
--------------------------------------------------------------------------------
1 | bar() { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_naming_recursion.sgrep:
--------------------------------------------------------------------------------
1 | $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_semicolon.sgrep:
--------------------------------------------------------------------------------
1 | foo(...);
2 |
--------------------------------------------------------------------------------
/tests/patterns/yaml/tag_literal.sgrep:
--------------------------------------------------------------------------------
1 | !thetag $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/yaml/tag_metavar.sgrep:
--------------------------------------------------------------------------------
1 | !$TAG $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/yaml/unicode.sgrep:
--------------------------------------------------------------------------------
1 | unicode: ジャパン
2 |
--------------------------------------------------------------------------------
/cli/src/semgrep/__init__.py:
--------------------------------------------------------------------------------
1 | __VERSION__ = "1.121.0"
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/empty/totally_empty_file:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/rule_id/hello.txt:
--------------------------------------------------------------------------------
1 | hello
2 |
--------------------------------------------------------------------------------
/languages/regexp/.gitignore:
--------------------------------------------------------------------------------
1 | /Parser.ml
2 | /Parser.mli
3 |
--------------------------------------------------------------------------------
/perf/bench/dummy/targets/hello.js:
--------------------------------------------------------------------------------
1 | exec("fortune");
2 |
--------------------------------------------------------------------------------
/src/spacegrep/.gitignore:
--------------------------------------------------------------------------------
1 | _build
2 | .merlin
3 | /tmp
4 |
--------------------------------------------------------------------------------
/src/spacegrep/examples/js-optional-chain.pat:
--------------------------------------------------------------------------------
1 | foo?.bar
2 |
--------------------------------------------------------------------------------
/src/spacegrep/examples/ruby-erb.pat:
--------------------------------------------------------------------------------
1 | "Version": "..."
2 |
--------------------------------------------------------------------------------
/src/spacegrep/src/test/.ocamlformat-ignore:
--------------------------------------------------------------------------------
1 | Comment.ml
2 |
--------------------------------------------------------------------------------
/tests/TODO/stmt.sgrep:
--------------------------------------------------------------------------------
1 | if $X:
2 | $Y
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tests/autofix/cairo/fix_vardef.fix:
--------------------------------------------------------------------------------
1 | const bar : int = $V;
--------------------------------------------------------------------------------
/tests/autofix/csharp/fix_vardef.sgrep:
--------------------------------------------------------------------------------
1 | int foo = $V;
2 |
--------------------------------------------------------------------------------
/tests/autofix/python/fix_within_binop.fix:
--------------------------------------------------------------------------------
1 | bar() + 2
2 |
--------------------------------------------------------------------------------
/tests/autofix/python/metavar_string2.fix:
--------------------------------------------------------------------------------
1 | bar("$VAR")
2 |
--------------------------------------------------------------------------------
/tests/irrelevant_rules/mvar-regex2.go:
--------------------------------------------------------------------------------
1 | import "foo/bar"
2 |
--------------------------------------------------------------------------------
/tests/irrelevant_rules/taint-general-source.py:
--------------------------------------------------------------------------------
1 | call(input)
--------------------------------------------------------------------------------
/tests/jsonnet/pass/concat1.jsonnet:
--------------------------------------------------------------------------------
1 | ["foo" + "bar"]
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/concat2.jsonnet:
--------------------------------------------------------------------------------
1 | ["foo" + [1,2]]
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/obj_access.json:
--------------------------------------------------------------------------------
1 | {"foo":1,"bar":2}
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/self_access.json:
--------------------------------------------------------------------------------
1 | {"foo":42,"bar":42}
--------------------------------------------------------------------------------
/tests/jsonnet/pass/string_access.jsonnet:
--------------------------------------------------------------------------------
1 | "foobar"[0]
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/tutorial/pass/garnish.txt:
--------------------------------------------------------------------------------
1 | Maraschino Cherry
--------------------------------------------------------------------------------
/tests/misc/il/assert.py:
--------------------------------------------------------------------------------
1 | def foo():
2 | assert 1 == 1
3 |
--------------------------------------------------------------------------------
/tests/misc/il/basic.py:
--------------------------------------------------------------------------------
1 | def foo():
2 | return 1+2
3 |
--------------------------------------------------------------------------------
/tests/misc/il/call.py:
--------------------------------------------------------------------------------
1 | def foo():
2 | a = bar()
3 |
--------------------------------------------------------------------------------
/tests/parsing/csharp/extern_alias.cs:
--------------------------------------------------------------------------------
1 | extern alias Foo;
2 |
--------------------------------------------------------------------------------
/tests/parsing/dockerfile/user.dockerfile:
--------------------------------------------------------------------------------
1 | USER alpha
2 |
--------------------------------------------------------------------------------
/tests/parsing/lua/hello_world.lua:
--------------------------------------------------------------------------------
1 | print "Hello World!"
2 |
--------------------------------------------------------------------------------
/tests/parsing_patterns/java/import.java:
--------------------------------------------------------------------------------
1 | import a.b.c;
2 |
--------------------------------------------------------------------------------
/tests/parsing_patterns/java/import.sgrep:
--------------------------------------------------------------------------------
1 | import $P;
2 |
--------------------------------------------------------------------------------
/tests/parsing_patterns/java/package.sgrep:
--------------------------------------------------------------------------------
1 | package $X;
2 |
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/concrete_syntax.sgrep:
--------------------------------------------------------------------------------
1 | foo(1, 2)
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/equivalence_float.sgrep:
--------------------------------------------------------------------------------
1 | 1.23
2 |
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/metavar_string.sgrep:
--------------------------------------------------------------------------------
1 | foo("$VAR")
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/partial_class.sgrep:
--------------------------------------------------------------------------------
1 | class $A
2 |
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/partial_if.sgrep:
--------------------------------------------------------------------------------
1 | if($X > $Y)
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/arg-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | echo ... hello
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/deep_exprstmt.sgrep:
--------------------------------------------------------------------------------
1 | foo
2 | bar
3 |
--------------------------------------------------------------------------------
/tests/patterns/bash/metavar_call.sgrep:
--------------------------------------------------------------------------------
1 | $CMD foo bar
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/not-an-expression2.sgrep:
--------------------------------------------------------------------------------
1 | foo > bar
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/not-an-expression3.sgrep:
--------------------------------------------------------------------------------
1 | foo &
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/not-an-expression4.sgrep:
--------------------------------------------------------------------------------
1 | foo bar
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/not-an-expression5.sgrep:
--------------------------------------------------------------------------------
1 | foo | bar
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/set-rhs-metavar.sgrep:
--------------------------------------------------------------------------------
1 | HOME=$ANY
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/todo/var-ellipsis-var.bash:
--------------------------------------------------------------------------------
1 | 'a'b
2 |
--------------------------------------------------------------------------------
/tests/patterns/c/anonymous_metavar.c:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2;
--------------------------------------------------------------------------------
/tests/patterns/c/dots_params.sgrep:
--------------------------------------------------------------------------------
1 | int $F(...) {
2 | }
3 |
--------------------------------------------------------------------------------
/tests/patterns/c/metavar_typed.sgrep:
--------------------------------------------------------------------------------
1 | (char *$X) == $Y
2 |
--------------------------------------------------------------------------------
/tests/patterns/cairo/dots_args.sgrep:
--------------------------------------------------------------------------------
1 |
2 | bar(...);
3 |
--------------------------------------------------------------------------------
/tests/patterns/cairo/metavar_let.sgrep:
--------------------------------------------------------------------------------
1 | let $X = $Y;
2 |
--------------------------------------------------------------------------------
/tests/patterns/clojure/concrete_syntax.sgrep:
--------------------------------------------------------------------------------
1 | (foo 1 2)
2 |
--------------------------------------------------------------------------------
/tests/patterns/clojure/dots_args.sgrep:
--------------------------------------------------------------------------------
1 | (foo ... 5)
2 |
--------------------------------------------------------------------------------
/tests/patterns/clojure/metavar_arg.sgrep:
--------------------------------------------------------------------------------
1 | (foo $X 2)
2 |
--------------------------------------------------------------------------------
/tests/patterns/clojure/metavar_call.sgrep:
--------------------------------------------------------------------------------
1 | ($F 1 2)
2 |
--------------------------------------------------------------------------------
/tests/patterns/cpp/misc_include.sgrep:
--------------------------------------------------------------------------------
1 | #include
2 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/deep_expr_operator.sgrep:
--------------------------------------------------------------------------------
1 | <... 12 ...>
--------------------------------------------------------------------------------
/tests/patterns/csharp/dots_class.sgrep:
--------------------------------------------------------------------------------
1 | class Foo { ... }
--------------------------------------------------------------------------------
/tests/patterns/csharp/dots_string.sgrep:
--------------------------------------------------------------------------------
1 | Foo("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_arg.sgrep:
--------------------------------------------------------------------------------
1 | Foo($X, 2)
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/arg-metavar.sgrep:
--------------------------------------------------------------------------------
1 | ARG $VAR
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/cmd-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | CMD ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/cmd-shell.sgrep:
--------------------------------------------------------------------------------
1 | CMD ...;
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/dots_args.sgrep:
--------------------------------------------------------------------------------
1 | foo ... 5
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/dots_string.sgrep:
--------------------------------------------------------------------------------
1 | foo "..."
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/env-const-prop.sgrep:
--------------------------------------------------------------------------------
1 | EXPOSE 0
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/env-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | ENV ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/from-param.sgrep:
--------------------------------------------------------------------------------
1 | FROM alpine
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/label.sgrep:
--------------------------------------------------------------------------------
1 | LABEL a=b c=d
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/metavar_arg.sgrep:
--------------------------------------------------------------------------------
1 | foo $X 2
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/no-trailing-newline.sgrep:
--------------------------------------------------------------------------------
1 | CMD ...
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/onbuild.sgrep:
--------------------------------------------------------------------------------
1 | ONBUILD RUN ls
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/run-anchored.sgrep:
--------------------------------------------------------------------------------
1 | RUN b
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/volume.sgrep:
--------------------------------------------------------------------------------
1 | VOLUME /var/log
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/dots_for.sgrep:
--------------------------------------------------------------------------------
1 | for ... {
2 | ...
3 | }
--------------------------------------------------------------------------------
/tests/patterns/go/imports_metavar.sgrep:
--------------------------------------------------------------------------------
1 | import ("$X")
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/metavar_package.sgrep:
--------------------------------------------------------------------------------
1 | package $X;
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/metavar_typed.sgrep:
--------------------------------------------------------------------------------
1 | $X == ($Y : string)
--------------------------------------------------------------------------------
/tests/patterns/go/misc_exprstmt_vs_expr.sgrep:
--------------------------------------------------------------------------------
1 | $X == $Y
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/misc_import.sgrep:
--------------------------------------------------------------------------------
1 | import ("foo")
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/misc_package.sgrep:
--------------------------------------------------------------------------------
1 | package hacknews
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/package_metavar.sgrep:
--------------------------------------------------------------------------------
1 | package $X;
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/partial_single_field.sgrep:
--------------------------------------------------------------------------------
1 | OK: $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/html/metavar_tag.sgrep:
--------------------------------------------------------------------------------
1 | <$X a="1">$X>
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/better_import4.sgrep:
--------------------------------------------------------------------------------
1 | A.B.C.D.foo(...)
--------------------------------------------------------------------------------
/tests/patterns/java/cp_switch_throw.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/cp_synchronized.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/cp_synchronized1.sgrep:
--------------------------------------------------------------------------------
1 | test("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_idspecial.sgrep:
--------------------------------------------------------------------------------
1 | $FUNC(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_name.sgrep:
--------------------------------------------------------------------------------
1 | import $LIB;
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_at_interface.sgrep:
--------------------------------------------------------------------------------
1 | asdf(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_precedence.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_super_call.sgrep:
--------------------------------------------------------------------------------
1 | super(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/partial_method.sgrep:
--------------------------------------------------------------------------------
1 | void foo(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/caching_deep.sgrep:
--------------------------------------------------------------------------------
1 | 2;
2 | ...
3 | 3;
4 |
--------------------------------------------------------------------------------
/tests/patterns/js/caching_flat.sgrep:
--------------------------------------------------------------------------------
1 | 2;
2 | ...
3 | 4;
4 |
--------------------------------------------------------------------------------
/tests/patterns/js/cp_conditional.sgrep:
--------------------------------------------------------------------------------
1 | require('...')
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/cp_dataflow.sgrep:
--------------------------------------------------------------------------------
1 | value = obj["..."]
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/deep_jsx.sgrep:
--------------------------------------------------------------------------------
1 | <$TAG attr="1" />
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_jsx_attr.sgrep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_jsx_body2.sgrep:
--------------------------------------------------------------------------------
1 | ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_object2.sgrep:
--------------------------------------------------------------------------------
1 | var X = {...};
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/infer_const.sgrep:
--------------------------------------------------------------------------------
1 | console.log("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/metavar_regexp.sgrep:
--------------------------------------------------------------------------------
1 | foo(/$X/, "$X")
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_arrow2.sgrep:
--------------------------------------------------------------------------------
1 | (...) => { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_jsx.sgrep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_regexp_modifier.sgrep:
--------------------------------------------------------------------------------
1 | /.../g
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_yield_undefined.sgrep:
--------------------------------------------------------------------------------
1 | yield
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/object_numeric_key.sgrep:
--------------------------------------------------------------------------------
1 | {1:...}
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/semgrep/jsx.sgrep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/tests/patterns/json/anonymous_metavar.json:
--------------------------------------------------------------------------------
1 | // ERROR:
2 | 2
--------------------------------------------------------------------------------
/tests/patterns/julia/implicit_return.sgrep:
--------------------------------------------------------------------------------
1 | return $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/julia/import_alias.sgrep:
--------------------------------------------------------------------------------
1 | import $X as $Y
--------------------------------------------------------------------------------
/tests/patterns/julia/import_metavar.sgrep:
--------------------------------------------------------------------------------
1 | using $MODULE
--------------------------------------------------------------------------------
/tests/patterns/kotlin/not_string_metavar.sgrep:
--------------------------------------------------------------------------------
1 | "hi $THERE"
--------------------------------------------------------------------------------
/tests/patterns/move_on_aptos/dots_string.sgrep:
--------------------------------------------------------------------------------
1 | foo(b"...")
--------------------------------------------------------------------------------
/tests/patterns/move_on_aptos/misc_address_value.sgrep:
--------------------------------------------------------------------------------
1 | @$VAL
--------------------------------------------------------------------------------
/tests/patterns/move_on_sui/dots_string.sgrep:
--------------------------------------------------------------------------------
1 | foo(b"...")
--------------------------------------------------------------------------------
/tests/patterns/ocaml/concrete_syntax.sgrep:
--------------------------------------------------------------------------------
1 | foo 1 2
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/dots_params.sgrep:
--------------------------------------------------------------------------------
1 | let $F ... = 1
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/equivalence_number.sgrep:
--------------------------------------------------------------------------------
1 | 1000
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/misc_ctor_one_arg.sgrep:
--------------------------------------------------------------------------------
1 | Foo $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/misc_match_case.sgrep:
--------------------------------------------------------------------------------
1 | | _ -> $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/case_insensitive_function_id.sgrep:
--------------------------------------------------------------------------------
1 | foo
--------------------------------------------------------------------------------
/tests/patterns/php/dots_args_isset.sgrep:
--------------------------------------------------------------------------------
1 | isset(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/dots_array.sgrep:
--------------------------------------------------------------------------------
1 | $ARRAY = [...];
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/dots_include1.sgrep:
--------------------------------------------------------------------------------
1 | include(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/sgrep/expr_pattern.php:
--------------------------------------------------------------------------------
1 | foo(1,2)
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/sgrep/multi.sgrep:
--------------------------------------------------------------------------------
1 | foo()
2 | bar()
3 |
--------------------------------------------------------------------------------
/tests/patterns/php/spatch/todo/1.php:
--------------------------------------------------------------------------------
1 | ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/promql/selector_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | {...}
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/ac_matching_free.sgrep:
--------------------------------------------------------------------------------
1 | A & B
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/ac_matching_mvars.sgrep:
--------------------------------------------------------------------------------
1 | A & $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/ac_matching_mvars2.sgrep:
--------------------------------------------------------------------------------
1 | $X & $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_eval1.sgrep:
--------------------------------------------------------------------------------
1 | eval("...")
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_eval2.sgrep:
--------------------------------------------------------------------------------
1 | eval("...")
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_string_mvar.sgrep:
--------------------------------------------------------------------------------
1 | return "$X"
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/cp_strings.sgrep:
--------------------------------------------------------------------------------
1 | return "..."
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/deep_exprstmt.sgrep:
--------------------------------------------------------------------------------
1 | foo()
2 | bar()
--------------------------------------------------------------------------------
/tests/patterns/python/dots_return.sgrep:
--------------------------------------------------------------------------------
1 | return ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | import foo.$BAR
--------------------------------------------------------------------------------
/tests/patterns/python/metavar_typed.sgrep:
--------------------------------------------------------------------------------
1 | foo($X: int)
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/misc_fake_propa.sgrep:
--------------------------------------------------------------------------------
1 | $X = 50
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/misc_faketok2.sgrep:
--------------------------------------------------------------------------------
1 | "=~/.*bento.*/"
--------------------------------------------------------------------------------
/tests/patterns/python/misc_metavar_vs_fstring.sgrep:
--------------------------------------------------------------------------------
1 | $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/misc_prefix_string.sgrep:
--------------------------------------------------------------------------------
1 | $X != $X
--------------------------------------------------------------------------------
/tests/patterns/python/misc_with_no_rename.sgrep:
--------------------------------------------------------------------------------
1 | foo()
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/wildcard_qualified_mvar.sgrep:
--------------------------------------------------------------------------------
1 | $A.x
--------------------------------------------------------------------------------
/tests/patterns/ql/dots_expr.sgrep:
--------------------------------------------------------------------------------
1 | // ERROR:
2 | 1 and ...
--------------------------------------------------------------------------------
/tests/patterns/r/anonymous_metavar.r:
--------------------------------------------------------------------------------
1 |
2 | # ERROR:
3 | 1
--------------------------------------------------------------------------------
/tests/patterns/ruby/cp_interpolated.sgrep:
--------------------------------------------------------------------------------
1 | foo("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/deep_exprstmt.sgrep:
--------------------------------------------------------------------------------
1 | foo()
2 | bar()
--------------------------------------------------------------------------------
/tests/patterns/ruby/dots_struct_new.sgrep:
--------------------------------------------------------------------------------
1 | Struct.new(...)
--------------------------------------------------------------------------------
/tests/patterns/ruby/implicit_return.sgrep:
--------------------------------------------------------------------------------
1 | return $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/lambda.sgrep:
--------------------------------------------------------------------------------
1 | $FOO = -> (...) {...}
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/metavar_atom.sgrep:
--------------------------------------------------------------------------------
1 | foo(:$ATOM)
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | require $R
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_dotaccess.sgrep:
--------------------------------------------------------------------------------
1 | generator.hex
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_hidden_call.sgrep:
--------------------------------------------------------------------------------
1 | foo(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_multiple_assign.sgrep:
--------------------------------------------------------------------------------
1 | a = 1
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/cp_expr_stmt_if.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/dots_mod.sgrep:
--------------------------------------------------------------------------------
1 | mod tests { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/implicit_return.sgrep:
--------------------------------------------------------------------------------
1 | return $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/metavar_standalone.rs:
--------------------------------------------------------------------------------
1 | // ERROR:
2 | 4;
--------------------------------------------------------------------------------
/tests/patterns/rust/misc_scoped_idents_as.sgrep:
--------------------------------------------------------------------------------
1 | A::B::f
--------------------------------------------------------------------------------
/tests/patterns/scala/custom_interpolated.sgrep:
--------------------------------------------------------------------------------
1 | abcd"..."
--------------------------------------------------------------------------------
/tests/patterns/scala/dots_match.sgrep:
--------------------------------------------------------------------------------
1 | $X match { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/scala/implicit_return.sgrep:
--------------------------------------------------------------------------------
1 | return $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/scala/import_metavariable.sgrep:
--------------------------------------------------------------------------------
1 | import $X
--------------------------------------------------------------------------------
/tests/patterns/scala/minus_identifier.sgrep:
--------------------------------------------------------------------------------
1 | val - = ...
--------------------------------------------------------------------------------
/tests/patterns/swift/class_variants.sgrep:
--------------------------------------------------------------------------------
1 | class Foo {}
2 |
--------------------------------------------------------------------------------
/tests/patterns/swift/semgrep_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | ... + 1
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/import_vN.sgrep:
--------------------------------------------------------------------------------
1 | import * as v8 from "v8";
--------------------------------------------------------------------------------
/tests/patterns/yaml/metavar_field.sgrep:
--------------------------------------------------------------------------------
1 | - name: $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/yaml/post_unicode.sgrep:
--------------------------------------------------------------------------------
1 | other: $VALUE
2 |
--------------------------------------------------------------------------------
/tests/patterns/yaml/semgrep/ellipses_only.sgrep:
--------------------------------------------------------------------------------
1 | ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/yaml/semgrep/field.sgrep:
--------------------------------------------------------------------------------
1 | language: $X
2 |
--------------------------------------------------------------------------------
/tests/perf/bloom/stmts-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | ...
2 | foo($A);
3 |
--------------------------------------------------------------------------------
/tests/rules/skip_list.txt:
--------------------------------------------------------------------------------
1 | file: lib_semgrep.jsonnet
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/pnpm/foo.js:
--------------------------------------------------------------------------------
1 | bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/ignores/find.js:
--------------------------------------------------------------------------------
1 | var x = 0 == 0
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/ignores/ok/find.js:
--------------------------------------------------------------------------------
1 | var x = 0 == 0
--------------------------------------------------------------------------------
/libs/murmur3/Murmur3.mli:
--------------------------------------------------------------------------------
1 | val hash128 : string -> string
2 |
--------------------------------------------------------------------------------
/src/osemgrep/cli_ci/Unit_ci.mli:
--------------------------------------------------------------------------------
1 | val tests : Testo.t list
2 |
--------------------------------------------------------------------------------
/src/parsing/Parsing_stats.atd:
--------------------------------------------------------------------------------
1 | ../../interfaces/Parsing_stats.atd
--------------------------------------------------------------------------------
/src/spacegrep/examples/my_first_calculator.py.pat:
--------------------------------------------------------------------------------
1 | = 42 "
2 |
--------------------------------------------------------------------------------
/tests/TODO/foo.js:
--------------------------------------------------------------------------------
1 | function foo() {
2 | foo(1);
3 | }
4 |
--------------------------------------------------------------------------------
/tests/TODO/stmt_dots.sgrep:
--------------------------------------------------------------------------------
1 | if $X:
2 | ...
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tests/autofix/cairo/fix_vardef.sgrep:
--------------------------------------------------------------------------------
1 | const foo : int = $V;
2 |
--------------------------------------------------------------------------------
/tests/autofix/ocaml/val.ml:
--------------------------------------------------------------------------------
1 | (* MATCH: *)
2 | val foo: int
3 |
--------------------------------------------------------------------------------
/tests/autofix/python/aligned_fix.py:
--------------------------------------------------------------------------------
1 | def f():
2 | to_replace()
--------------------------------------------------------------------------------
/tests/autofix/python/aligned_fix_non_ast.sgrep:
--------------------------------------------------------------------------------
1 | to_replace(...)
--------------------------------------------------------------------------------
/tests/autofix/python/capture_group.py:
--------------------------------------------------------------------------------
1 | #MATCH:
2 | f(12345)
3 |
--------------------------------------------------------------------------------
/tests/autofix/python/fix_dotted_ident.fix:
--------------------------------------------------------------------------------
1 | bar.$X($...ARGS)
2 |
--------------------------------------------------------------------------------
/tests/autofix/rust/fix_vardef.sgrep:
--------------------------------------------------------------------------------
1 | const foo : int;
2 |
3 |
--------------------------------------------------------------------------------
/tests/autofix/solidity/fix_vardef.fix:
--------------------------------------------------------------------------------
1 | int constant bar = $V;
--------------------------------------------------------------------------------
/tests/jsonnet/errors/error2.jsonnet:
--------------------------------------------------------------------------------
1 | [1, error [1,2]]
2 |
3 |
--------------------------------------------------------------------------------
/tests/jsonnet/only_envir/format_percent.json:
--------------------------------------------------------------------------------
1 | "Hello 12"
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/only_envir/format_string.json:
--------------------------------------------------------------------------------
1 | "foostuffbar"
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/inf.jsonnet:
--------------------------------------------------------------------------------
1 | local val = 0;
2 | val <= -1
3 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/locals_in_objects.json:
--------------------------------------------------------------------------------
1 | { "x": 4, "y": 3 }
--------------------------------------------------------------------------------
/tests/jsonnet/pass/plus_object.json:
--------------------------------------------------------------------------------
1 | {"bar":2,"foo":2,"foobar":2}
--------------------------------------------------------------------------------
/tests/jsonnet/pass/self_bound_correctly_in_superobjects.json:
--------------------------------------------------------------------------------
1 | 2
--------------------------------------------------------------------------------
/tests/parsing/c/basic.c:
--------------------------------------------------------------------------------
1 |
2 | int main() {
3 | return 0;
4 | }
--------------------------------------------------------------------------------
/tests/parsing/dockerfile/numeric-user.dockerfile:
--------------------------------------------------------------------------------
1 | USER 1000
2 |
--------------------------------------------------------------------------------
/tests/parsing/jsonnet/foo.jsonnet:
--------------------------------------------------------------------------------
1 | foo(1, 2)
2 | #null
3 |
4 |
--------------------------------------------------------------------------------
/tests/parsing/jsonnet/string.jsonnet:
--------------------------------------------------------------------------------
1 | local x = 'foo';
2 | 1
3 |
--------------------------------------------------------------------------------
/tests/parsing/julia/helloworld.jl:
--------------------------------------------------------------------------------
1 | println("hello world")
2 |
--------------------------------------------------------------------------------
/tests/parsing/ocaml/basic.mli:
--------------------------------------------------------------------------------
1 | val foo: int -> bool
2 |
3 |
--------------------------------------------------------------------------------
/tests/parsing/python/re.py:
--------------------------------------------------------------------------------
1 | re.match(foo, "0|false|null")
2 |
--------------------------------------------------------------------------------
/tests/parsing/scala/fun_dcl.scala:
--------------------------------------------------------------------------------
1 | trait foo:
2 | def bar : T
--------------------------------------------------------------------------------
/tests/parsing/swift/hello-world.swift:
--------------------------------------------------------------------------------
1 | print("hello world")
2 |
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/dots_for.sgrep:
--------------------------------------------------------------------------------
1 | for(...) { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/equivalence_number.sgrep:
--------------------------------------------------------------------------------
1 | 8
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/metavar_equality_expr.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/partial_try.sgrep:
--------------------------------------------------------------------------------
1 | try { ... }
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/bash/anonymous_metavar.bash:
--------------------------------------------------------------------------------
1 |
2 | # ERROR:
3 | a=3
--------------------------------------------------------------------------------
/tests/patterns/bash/concatenation.bash:
--------------------------------------------------------------------------------
1 | # MATCH:
2 | a'b'
3 |
--------------------------------------------------------------------------------
/tests/patterns/bash/function.sgrep:
--------------------------------------------------------------------------------
1 | function f(){ ...; }
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/quoted-ellipsis2.sgrep:
--------------------------------------------------------------------------------
1 | "${$A}...${$B}"
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/quoted-named-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | "$...X"
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/set-lhs-metavar.bash:
--------------------------------------------------------------------------------
1 | # MATCH:
2 | a=42
3 |
--------------------------------------------------------------------------------
/tests/patterns/c/const-prop-buf-decl.sgrep:
--------------------------------------------------------------------------------
1 | $TYPE $NAME[42];
2 |
--------------------------------------------------------------------------------
/tests/patterns/c/misc_typedef_inference.sgrep:
--------------------------------------------------------------------------------
1 | sizeof($X)
2 |
--------------------------------------------------------------------------------
/tests/patterns/cpp/anonymous_metavar.cpp:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2;
--------------------------------------------------------------------------------
/tests/patterns/cpp/dots_params.sgrep:
--------------------------------------------------------------------------------
1 | int $F(...) {
2 | }
3 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_class_def.sgrep:
--------------------------------------------------------------------------------
1 | class $KLASS {}
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_cond.sgrep:
--------------------------------------------------------------------------------
1 | if ($COND) { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_equality_expr.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_typed.sgrep:
--------------------------------------------------------------------------------
1 | $X == (String $Y)
2 |
--------------------------------------------------------------------------------
/tests/patterns/dart/anonymous_metavar.dart:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2;
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/add.sgrep:
--------------------------------------------------------------------------------
1 | ADD file1 file2 /mydir/
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/array-metavariable.sgrep:
--------------------------------------------------------------------------------
1 | RUN [$X]
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/copy-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | COPY ... $DST
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/copy-metavar.sgrep:
--------------------------------------------------------------------------------
1 | COPY foo $DST
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/deep_exprstmt.sgrep:
--------------------------------------------------------------------------------
1 | foo
2 | bar
3 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/from-as.sgrep:
--------------------------------------------------------------------------------
1 | FROM debian AS deb
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/label-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | LABEL ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/metavar_call.sgrep:
--------------------------------------------------------------------------------
1 | $CMD foo bar
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/multiline_comment.sgrep:
--------------------------------------------------------------------------------
1 | echo "bar"
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/string-comparison.sgrep:
--------------------------------------------------------------------------------
1 | ENV X a
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/user-group.sgrep:
--------------------------------------------------------------------------------
1 | USER root:root
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/anonymous_metavar.go:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 1;
--------------------------------------------------------------------------------
/tests/patterns/go/make_tri_pat.sgrep:
--------------------------------------------------------------------------------
1 | make($TY,...,$ARG)
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/misc_empty_body.sgrep:
--------------------------------------------------------------------------------
1 | if (...) {
2 | }
3 |
--------------------------------------------------------------------------------
/tests/patterns/go/regexp_caret.sgrep:
--------------------------------------------------------------------------------
1 | $SECRET := "=~/\^/i"
2 |
--------------------------------------------------------------------------------
/tests/patterns/hack/TODO/equivalence_eq.sgrep:
--------------------------------------------------------------------------------
1 | $X == $X;
2 |
--------------------------------------------------------------------------------
/tests/patterns/hack/anonymous_metavar.hack:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2;
--------------------------------------------------------------------------------
/tests/patterns/java/anonymous_metavar.java:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2;
--------------------------------------------------------------------------------
/tests/patterns/java/cp_string_format.sgrep:
--------------------------------------------------------------------------------
1 | foobar("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/dots_params.sgrep:
--------------------------------------------------------------------------------
1 | void foo(...) { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/dots_vardef.sgrep:
--------------------------------------------------------------------------------
1 | String $VAR = "...";
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/less_generics.sgrep:
--------------------------------------------------------------------------------
1 | class $X { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | import java.util.$X;
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_package.sgrep:
--------------------------------------------------------------------------------
1 | package $PACKAGE;
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_typed.sgrep:
--------------------------------------------------------------------------------
1 | $X == (String $Y)
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_typed_localvar.sgrep:
--------------------------------------------------------------------------------
1 | (Bar[] $B)
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_class_literal.sgrep:
--------------------------------------------------------------------------------
1 | Hello.class
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_static_block.sgrep:
--------------------------------------------------------------------------------
1 | static { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/try_mutli_resources.sgrep:
--------------------------------------------------------------------------------
1 | zipFileName
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/visit_attribute.sgrep:
--------------------------------------------------------------------------------
1 | @SomeAnnot(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/anonymous_metavar.js:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2;
--------------------------------------------------------------------------------
/tests/patterns/js/caching_nested.sgrep:
--------------------------------------------------------------------------------
1 | 2;
2 | ...
3 | 4;
4 |
--------------------------------------------------------------------------------
/tests/patterns/js/cp_undeclared.sgrep:
--------------------------------------------------------------------------------
1 | console.log("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/cp_undeclared1.sgrep:
--------------------------------------------------------------------------------
1 | value = obj["..."]
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_container2.sgrep:
--------------------------------------------------------------------------------
1 | var $X = [...,1];
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_field_chaining.sgrep:
--------------------------------------------------------------------------------
1 | foo. ... .bar
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_jsx_body.sgrep:
--------------------------------------------------------------------------------
1 | ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/infer_const_regexp.sgrep:
--------------------------------------------------------------------------------
1 | new RegExp(/a/)
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/metavar_jsx_attr.sgrep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/metavar_jsx_tag.sgrep:
--------------------------------------------------------------------------------
1 | <$XXX attr="1" />
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/metavar_jsx_val.sgrep:
--------------------------------------------------------------------------------
1 | ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/metavar_template.sgrep:
--------------------------------------------------------------------------------
1 | `$LEFT${...}$RIGHT`
--------------------------------------------------------------------------------
/tests/patterns/js/misc_asi_pattern.sgrep:
--------------------------------------------------------------------------------
1 | foo(r => {bar(r)})
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_empty_body.sgrep:
--------------------------------------------------------------------------------
1 | if (...) {
2 | }
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_method_brace_newline.sgrep:
--------------------------------------------------------------------------------
1 | return 0;
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_notoken.sgrep:
--------------------------------------------------------------------------------
1 | $X = $Y;
2 | $X = $Z;
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_object_directly.sgrep:
--------------------------------------------------------------------------------
1 | { fld1: $X }
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/partial_catch.sgrep:
--------------------------------------------------------------------------------
1 | catch($E) { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/partial_function.sgrep:
--------------------------------------------------------------------------------
1 | function foo(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/template_string_w_metavar.sgrep:
--------------------------------------------------------------------------------
1 | `...${$X}...`
--------------------------------------------------------------------------------
/tests/patterns/json/deep_expr_operator.sgrep:
--------------------------------------------------------------------------------
1 | "foo": <... 42 ...>
--------------------------------------------------------------------------------
/tests/patterns/json/partial_single_field.sgrep:
--------------------------------------------------------------------------------
1 | "foo": $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/julia/anonymous_metavar.jl:
--------------------------------------------------------------------------------
1 |
2 | # ERROR:
3 | 2
--------------------------------------------------------------------------------
/tests/patterns/julia/let_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | let
2 | ...
3 | end
--------------------------------------------------------------------------------
/tests/patterns/kotlin/anonymous_metavar.kt:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2
--------------------------------------------------------------------------------
/tests/patterns/kotlin/deep_exprstmt.sgrep:
--------------------------------------------------------------------------------
1 | foo()
2 | bar()
3 |
--------------------------------------------------------------------------------
/tests/patterns/kotlin/in_class_const_prop.sgrep:
--------------------------------------------------------------------------------
1 | ($X : T).foo
--------------------------------------------------------------------------------
/tests/patterns/kotlin/interpolated_ident.sgrep:
--------------------------------------------------------------------------------
1 | "...${...}..."
--------------------------------------------------------------------------------
/tests/patterns/kotlin/metavar_typed.sgrep:
--------------------------------------------------------------------------------
1 | $X == ($Y : String)
--------------------------------------------------------------------------------
/tests/patterns/kotlin/single_interpolated_ident.sgrep:
--------------------------------------------------------------------------------
1 | "${temp}"
--------------------------------------------------------------------------------
/tests/patterns/lua/anonymous_metavar.lua:
--------------------------------------------------------------------------------
1 |
2 | -- ERROR:
3 | 2
--------------------------------------------------------------------------------
/tests/patterns/move_on_aptos/misc_vector_value.sgrep:
--------------------------------------------------------------------------------
1 | vector[...]
--------------------------------------------------------------------------------
/tests/patterns/move_on_sui/deep_exprstmt.sgrep:
--------------------------------------------------------------------------------
1 | foo();
2 | bar();
--------------------------------------------------------------------------------
/tests/patterns/ocaml/dots_let_body.sgrep:
--------------------------------------------------------------------------------
1 | let $X = ... in
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/metavar_equality_expr.sgrep:
--------------------------------------------------------------------------------
1 | $X = $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/misc_functor.sgrep:
--------------------------------------------------------------------------------
1 | try ... with _ -> ...
--------------------------------------------------------------------------------
/tests/patterns/ocaml/misc_try.sgrep:
--------------------------------------------------------------------------------
1 | try ... with ... -> ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/partial_let.sgrep:
--------------------------------------------------------------------------------
1 | let $X = $BODY in
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/backed_enum.sgrep:
--------------------------------------------------------------------------------
1 | $VAR = Suit::Clubs
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/constant_propogation.sgrep:
--------------------------------------------------------------------------------
1 | exec('...', ...)
--------------------------------------------------------------------------------
/tests/patterns/php/dots_interpolated.sgrep:
--------------------------------------------------------------------------------
1 | $X = "$MSG{$VAL}...";
--------------------------------------------------------------------------------
/tests/patterns/php/gh_5594.sgrep:
--------------------------------------------------------------------------------
1 | $this->logger->info(...);
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/misc_boolean_propagation.sgrep:
--------------------------------------------------------------------------------
1 | f(false);
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/sgrep/dots_in_brackets.php:
--------------------------------------------------------------------------------
1 | $foo[...]
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/sgrep/statement_pattern.php:
--------------------------------------------------------------------------------
1 | foo(1,2);
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/spatch/bar.exp:
--------------------------------------------------------------------------------
1 | )
--------------------------------------------------------------------------------
/tests/patterns/ql/dots_module.sgrep:
--------------------------------------------------------------------------------
1 | module $X {
2 | ...
3 | }
--------------------------------------------------------------------------------
/tests/patterns/ruby/anonymous_metavar.rb:
--------------------------------------------------------------------------------
1 |
2 | # ERROR:
3 | 2
--------------------------------------------------------------------------------
/tests/patterns/ruby/cp_string_mutable.sgrep:
--------------------------------------------------------------------------------
1 | test("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/metavar_regexp.sgrep:
--------------------------------------------------------------------------------
1 | foo(/$X/, "$X")
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_empty_token1.sgrep:
--------------------------------------------------------------------------------
1 | $STR.html_safe
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_kwdarg2.sgrep:
--------------------------------------------------------------------------------
1 | foo kwd1: $X, ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_kwdarg_dots.sgrep:
--------------------------------------------------------------------------------
1 | foo(bar:...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/anonymous_metavar.rs:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2;
--------------------------------------------------------------------------------
/tests/patterns/rust/dots_field_chaining.sgrep:
--------------------------------------------------------------------------------
1 | s. ... .z
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/dots_macro_call.sgrep:
--------------------------------------------------------------------------------
1 | println!(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/epattern_type_prop.sgrep:
--------------------------------------------------------------------------------
1 | sink(($X : T))
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/metavar_param.sgrep:
--------------------------------------------------------------------------------
1 | fn $F($X, ...) { ... }
--------------------------------------------------------------------------------
/tests/patterns/scala/anonymous_metavar.scala:
--------------------------------------------------------------------------------
1 | // ERROR:
2 | 2
--------------------------------------------------------------------------------
/tests/patterns/scala/class_params.sgrep:
--------------------------------------------------------------------------------
1 | ($OBJ : TypeName).foo
--------------------------------------------------------------------------------
/tests/patterns/solidity/misc_enum.sgrep:
--------------------------------------------------------------------------------
1 | enum $ENUM { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/solidity/misc_event.sgrep:
--------------------------------------------------------------------------------
1 | event $E(...);
2 |
--------------------------------------------------------------------------------
/tests/patterns/swift/class_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | class $CLASS { ... }
--------------------------------------------------------------------------------
/tests/patterns/ts/anonymous_metavar.ts:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2;
--------------------------------------------------------------------------------
/tests/patterns/ts/less_type_let.sgrep:
--------------------------------------------------------------------------------
1 | let $MSG = '...';
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/metavar_typed_class.sgrep:
--------------------------------------------------------------------------------
1 | ($X: C).f(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_as_cast.sgrep:
--------------------------------------------------------------------------------
1 | $VAR = $EXPR as $TYPE;
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_type3.sgrep:
--------------------------------------------------------------------------------
1 | class $X { $FLD: int; }
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/type_assert.sgrep:
--------------------------------------------------------------------------------
1 | (v8 as $T).$METH(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/xml/misc_attribute_pattern.sgrep:
--------------------------------------------------------------------------------
1 | foo="true"
2 |
--------------------------------------------------------------------------------
/tests/patterns/yaml/array_field_only.sgrep:
--------------------------------------------------------------------------------
1 | - "Job/Read"
2 |
--------------------------------------------------------------------------------
/tests/rules/vardef_assign_false.js:
--------------------------------------------------------------------------------
1 | //OK:test
2 | var x = 1;
3 |
--------------------------------------------------------------------------------
/cli/src/semdep/external/parsy/version.py:
--------------------------------------------------------------------------------
1 | __version__ = "2.0"
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/deduplication/deduplication.py:
--------------------------------------------------------------------------------
1 | foo(1,2)
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/js/sca.js:
--------------------------------------------------------------------------------
1 | x = bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/ruby/sca.rb:
--------------------------------------------------------------------------------
1 | x = bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/yarn2/foo.js:
--------------------------------------------------------------------------------
1 | bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/ignores/ignore.min.js:
--------------------------------------------------------------------------------
1 | var x = 0 == 0
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/ignores/ignore_test.js:
--------------------------------------------------------------------------------
1 | var x = 0 == 0
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/ignores/tests/ignore.js:
--------------------------------------------------------------------------------
1 | var x = 0 == 0
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/ignores_default/.gitignore:
--------------------------------------------------------------------------------
1 | ignore.js
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/ignores_default/find.js:
--------------------------------------------------------------------------------
1 | var x = 0 == 0
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/language-filtering/call-f.py:
--------------------------------------------------------------------------------
1 | f()
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/multilangproj/code.js:
--------------------------------------------------------------------------------
1 | var x = 1+1;
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/per-rule-include/scan-me.py:
--------------------------------------------------------------------------------
1 | f()
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/pro-rule-skipping-no-parsing/x.cls:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/sort-findings/z/a.py:
--------------------------------------------------------------------------------
1 | f()
2 | f()
3 |
--------------------------------------------------------------------------------
/interfaces/semgrep_interfaces:
--------------------------------------------------------------------------------
1 | ../cli/src/semgrep/semgrep_interfaces
--------------------------------------------------------------------------------
/libs/commons/tests/Unit_Result_.mli:
--------------------------------------------------------------------------------
1 | val tests : Testo.t list
2 |
--------------------------------------------------------------------------------
/perf/bench/dummy/input/dummy/targets/hello.js:
--------------------------------------------------------------------------------
1 | exec("fortune");
2 |
--------------------------------------------------------------------------------
/perf/bench/dummy/targets/malformed.js:
--------------------------------------------------------------------------------
1 | // malformed js file
2 | )
3 |
--------------------------------------------------------------------------------
/src/configuring/Rule_options.atd:
--------------------------------------------------------------------------------
1 | ../../interfaces/Rule_options.atd
--------------------------------------------------------------------------------
/src/lsp/Unit_LS.mli:
--------------------------------------------------------------------------------
1 | val tests : Session.caps -> Testo.t list
2 |
--------------------------------------------------------------------------------
/src/osemgrep/reporting/Gated_data.ml:
--------------------------------------------------------------------------------
1 | let msg = "requires login"
2 |
--------------------------------------------------------------------------------
/src/rule/Language.ml:
--------------------------------------------------------------------------------
1 | ../../interfaces/semgrep_interfaces/Language.ml
--------------------------------------------------------------------------------
/src/spacegrep/examples/go-package.pat:
--------------------------------------------------------------------------------
1 | package hacknews
2 | ...
3 |
--------------------------------------------------------------------------------
/src/spacegrep/examples/go-package.url:
--------------------------------------------------------------------------------
1 | https://semgrep.dev/Nxwy/
2 |
--------------------------------------------------------------------------------
/src/spacegrep/examples/hello.pat:
--------------------------------------------------------------------------------
1 | function ... { ... hello ... }
2 |
--------------------------------------------------------------------------------
/tests/TODO/expr_vs_stmt_metavar.sgrep:
--------------------------------------------------------------------------------
1 | if $X:
2 | $Y
3 | $Y
4 |
--------------------------------------------------------------------------------
/tests/TODO/stmt_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | $V = open()
2 | ...
3 | close($V)
4 |
--------------------------------------------------------------------------------
/tests/TODO/stupid_if.sgrep:
--------------------------------------------------------------------------------
1 | if($X):
2 | $S
3 | else:
4 | $S
5 |
--------------------------------------------------------------------------------
/tests/autofix/js/fix_obj.fixed:
--------------------------------------------------------------------------------
1 | // MATCH:
2 | foo({x: true});
3 |
--------------------------------------------------------------------------------
/tests/autofix/ocaml/val.fixed:
--------------------------------------------------------------------------------
1 | (* MATCH: *)
2 | val foo : float
3 |
--------------------------------------------------------------------------------
/tests/autofix/python/aligned_fix_non_ast.fix:
--------------------------------------------------------------------------------
1 | foo()
2 | def def def
--------------------------------------------------------------------------------
/tests/autofix/python/capture_group.fixed:
--------------------------------------------------------------------------------
1 | #MATCH:
2 | f(54321)
3 |
--------------------------------------------------------------------------------
/tests/autofix/python/fix_dotted_ident.sgrep:
--------------------------------------------------------------------------------
1 | foo.$X($...ARGS)
2 |
--------------------------------------------------------------------------------
/tests/autofix/python/regexp_count.fix-regex:
--------------------------------------------------------------------------------
1 | A([a-z])
2 | 2
3 | [\1]
--------------------------------------------------------------------------------
/tests/autofix/python/simple_regexp.fix-regex:
--------------------------------------------------------------------------------
1 | A([a-z])
2 | [\1]
3 |
--------------------------------------------------------------------------------
/tests/autofix/solidity/fix_vardef.sgrep:
--------------------------------------------------------------------------------
1 | int constant foo = $V;
2 |
--------------------------------------------------------------------------------
/tests/irrelevant_rules/pattern-and.py:
--------------------------------------------------------------------------------
1 | import child_process
2 |
3 | m
--------------------------------------------------------------------------------
/tests/irrelevant_rules/pattern-either.py:
--------------------------------------------------------------------------------
1 | import django
2 | import os
--------------------------------------------------------------------------------
/tests/jsonnet/errors/error1.jsonnet:
--------------------------------------------------------------------------------
1 | [1, error "problem houston"]
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/errors/floor_not_float.jsonnet:
--------------------------------------------------------------------------------
1 | std.floor("32.6")
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/only_envir/format_percent.jsonnet:
--------------------------------------------------------------------------------
1 | "Hello %d" % 12
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/only_subst/basic_super.json:
--------------------------------------------------------------------------------
1 | { "x": 2, "y": 3, "z": 2 }
--------------------------------------------------------------------------------
/tests/jsonnet/pass/simple_self.jsonnet:
--------------------------------------------------------------------------------
1 | { x: 1, y: self.x }.y
2 |
--------------------------------------------------------------------------------
/tests/misc/il/container.py:
--------------------------------------------------------------------------------
1 | def foo():
2 | a = [eval(1), 2, 3]
3 |
--------------------------------------------------------------------------------
/tests/misc/il/var.js:
--------------------------------------------------------------------------------
1 | function foo() {
2 | var x = 1;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/misc/target_file/target_file.list:
--------------------------------------------------------------------------------
1 | tests/js/concrete_syntax.js
--------------------------------------------------------------------------------
/tests/parsing/bash/and-cond.bash:
--------------------------------------------------------------------------------
1 | if a && b; then
2 | c
3 | fi
4 |
--------------------------------------------------------------------------------
/tests/parsing/dockerfile/no-trailing-newline.dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu
--------------------------------------------------------------------------------
/tests/parsing/kotlin/string.kt:
--------------------------------------------------------------------------------
1 | fun foo() {
2 | "what"
3 | }
4 |
--------------------------------------------------------------------------------
/tests/parsing/ocaml/attribute_type.ml:
--------------------------------------------------------------------------------
1 | type foo = int [@opaque]
2 |
--------------------------------------------------------------------------------
/tests/parsing/php/class.php:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/metavar_equality_expr.sgrep:
--------------------------------------------------------------------------------
1 | cp ... $X ... $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/normalize-dquoted-word.sgrep:
--------------------------------------------------------------------------------
1 | "hello" world
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/normalize-squoted-word.sgrep:
--------------------------------------------------------------------------------
1 | 'hello' world
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/not-an-expression4.bash:
--------------------------------------------------------------------------------
1 | # MATCH:
2 | foo bar
3 |
--------------------------------------------------------------------------------
/tests/patterns/bash/set-rhs-metavar.bash:
--------------------------------------------------------------------------------
1 | # MATCH:
2 | HOME=$X
3 |
--------------------------------------------------------------------------------
/tests/patterns/bash/stmt-named-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | a; $...STMT; b
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/todo/array-named-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | ar=($...X)
2 |
--------------------------------------------------------------------------------
/tests/patterns/c/const-prop-buf-decl-flow.sgrep:
--------------------------------------------------------------------------------
1 | $TYPE $NAME[50];
2 |
--------------------------------------------------------------------------------
/tests/patterns/c/misc_toplevel_macrocall.sgrep:
--------------------------------------------------------------------------------
1 | SOME_FUNC(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/cairo/dots_loop.sgrep:
--------------------------------------------------------------------------------
1 | loop {
2 | ...
3 | }
4 |
--------------------------------------------------------------------------------
/tests/patterns/circom/anonymous_metavar.circom:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 1;
--------------------------------------------------------------------------------
/tests/patterns/circom/metavar_version.sgrep:
--------------------------------------------------------------------------------
1 | pragma circom $PRAGMA;
--------------------------------------------------------------------------------
/tests/patterns/clojure/dots_string.sgrep:
--------------------------------------------------------------------------------
1 | (foo "...")
2 |
3 |
4 |
--------------------------------------------------------------------------------
/tests/patterns/clojure/metavar_slash_access.sgrep:
--------------------------------------------------------------------------------
1 | ($X/parse 1 2)
2 |
--------------------------------------------------------------------------------
/tests/patterns/cpp/dots_namespace.sgrep:
--------------------------------------------------------------------------------
1 | namespace VM { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_key_value.sgrep:
--------------------------------------------------------------------------------
1 | Foo(..., bar: 42, ...);
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/array-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | RUN ["sudo", ...]
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/cmd-argv.sgrep:
--------------------------------------------------------------------------------
1 | CMD ["echo", "hello"]
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/cmd-named-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | CMD $...ARGS
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/copy.sgrep:
--------------------------------------------------------------------------------
1 | COPY file1 file2 /mydir/
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/entrypoint.sgrep:
--------------------------------------------------------------------------------
1 | ENTRYPOINT ["s3cmd"]
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/env-val-metavar.sgrep:
--------------------------------------------------------------------------------
1 | ENV FOO=$VAL
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/env.sgrep:
--------------------------------------------------------------------------------
1 | ENV MY_NAME="John Doe"
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/from2.sgrep:
--------------------------------------------------------------------------------
1 | FROM debian:unstable-slim
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/instruction-metavariable.sgrep:
--------------------------------------------------------------------------------
1 | $INSTR
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/label-metavar.sgrep:
--------------------------------------------------------------------------------
1 | LABEL $KEY=$VALUE
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/maintainer.sgrep:
--------------------------------------------------------------------------------
1 | MAINTAINER nobody
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/run-argv.sgrep:
--------------------------------------------------------------------------------
1 | RUN ["echo", "hello"]
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/stopsignal.sgrep:
--------------------------------------------------------------------------------
1 | STOPSIGNAL SIGUSR1
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/todo/env-key-metavar.sgrep:
--------------------------------------------------------------------------------
1 | ENV $KEY=42
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/todo/string-fragments.sgrep:
--------------------------------------------------------------------------------
1 | ENV A abc
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/volume-metavar.sgrep:
--------------------------------------------------------------------------------
1 | VOLUME $VOLUME
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/workdir.sgrep:
--------------------------------------------------------------------------------
1 | WORKDIR /home/patrick
2 |
--------------------------------------------------------------------------------
/tests/patterns/generic/dots_string.sgrep:
--------------------------------------------------------------------------------
1 | foo(
2 | "..."
3 | )
4 |
--------------------------------------------------------------------------------
/tests/patterns/go/cp_shortassign.sgrep:
--------------------------------------------------------------------------------
1 | fmt.Println("...")
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/go/dots_nested_stmts.sgrep:
--------------------------------------------------------------------------------
1 | if $E {
2 | ...
3 | }
--------------------------------------------------------------------------------
/tests/patterns/go/dots_package.sgrep:
--------------------------------------------------------------------------------
1 | package hacknews
2 | ...
3 |
--------------------------------------------------------------------------------
/tests/patterns/go/dots_stmts.sgrep:
--------------------------------------------------------------------------------
1 | $X = get()
2 | ...
3 | eval($X)
--------------------------------------------------------------------------------
/tests/patterns/go/equivalence_naming_import1.sgrep:
--------------------------------------------------------------------------------
1 | jwt.BAD_CONST
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/make-args-trans.sgrep:
--------------------------------------------------------------------------------
1 | make(map[$T1]$T2, ...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/make_metavar_firstarg.sgrep:
--------------------------------------------------------------------------------
1 | $X := make($Y,$Z)
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/metavar_cond.sgrep:
--------------------------------------------------------------------------------
1 | if ($E) {
2 | foo()
3 | }
--------------------------------------------------------------------------------
/tests/patterns/go/metavar_stmt.sgrep:
--------------------------------------------------------------------------------
1 | if ($X > $Y) {
2 | $S;
3 | }
--------------------------------------------------------------------------------
/tests/patterns/go/misc_interface_method.sgrep:
--------------------------------------------------------------------------------
1 | $FOO(...) bool
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/misc_type_decl.sgrep:
--------------------------------------------------------------------------------
1 | type $X struct { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/cp_is_must_analysis.sgrep:
--------------------------------------------------------------------------------
1 | X.test("hello")
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/cp_is_must_analysis1.sgrep:
--------------------------------------------------------------------------------
1 | X.test("hello")
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/cp_is_must_analysis2.sgrep:
--------------------------------------------------------------------------------
1 | X.test("goodbye")
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/dots_generics.sgrep:
--------------------------------------------------------------------------------
1 | class Foo<...> { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/dots_import.sgrep:
--------------------------------------------------------------------------------
1 | import Foo.Bar;
2 | ...
3 |
--------------------------------------------------------------------------------
/tests/patterns/java/generics_args.sgrep:
--------------------------------------------------------------------------------
1 | (List<$TYPE> $ARGLIST)
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/import_metavar_fullpath.sgrep:
--------------------------------------------------------------------------------
1 | import $LIB;
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/less_inheritance.sgrep:
--------------------------------------------------------------------------------
1 | class A {
2 | ...
3 | }
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_typed_function.sgrep:
--------------------------------------------------------------------------------
1 | int $A() {...}
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_accent_record.sgrep:
--------------------------------------------------------------------------------
1 | class $X { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_constructor.sgrep:
--------------------------------------------------------------------------------
1 | MyJavaClass() { }
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_token_cast.sgrep:
--------------------------------------------------------------------------------
1 | (Object) this
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/java/partial_class_attr.sgrep:
--------------------------------------------------------------------------------
1 | @Attr
2 | class $A
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/caching_deep_metavar.sgrep:
--------------------------------------------------------------------------------
1 | $X;
2 | ...
3 | 3;
4 |
--------------------------------------------------------------------------------
/tests/patterns/js/cp_implicit_conversion.sgrep:
--------------------------------------------------------------------------------
1 | return 'abc1-2-3'
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/deep_expr_xml.sgrep:
--------------------------------------------------------------------------------
1 | <... {__html: `...`} ...>
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_jsx_attr_list.sgrep:
--------------------------------------------------------------------------------
1 | <$TAG attr="1" ... />
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_params.sgrep:
--------------------------------------------------------------------------------
1 | function foo(...) { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/equivalence_varlet.sgrep:
--------------------------------------------------------------------------------
1 | var $X = "hello";
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/less_class_complex.sgrep:
--------------------------------------------------------------------------------
1 | class A {
2 | ...
3 | }
--------------------------------------------------------------------------------
/tests/patterns/js/less_xml_body.sgrep:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | import $X from 'foo';
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/metavar_typed_bool.sgrep:
--------------------------------------------------------------------------------
1 | func(($VAL: boolean))
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_expr_vs_vardef.sgrep:
--------------------------------------------------------------------------------
1 | password = "...";
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_field_vs_vardef.sgrep:
--------------------------------------------------------------------------------
1 | $Y = {$X: "..."};
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_lambda.sgrep:
--------------------------------------------------------------------------------
1 | function() {
2 | ...
3 | }
--------------------------------------------------------------------------------
/tests/patterns/js/misc_string.js:
--------------------------------------------------------------------------------
1 | //ERROR: match
2 | foo("bar")
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/regexp.js:
--------------------------------------------------------------------------------
1 | //ERROR: match
2 | const x = /abc/;
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/semgrep/metavar_jsx.sgrep:
--------------------------------------------------------------------------------
1 | <$XXX attr="1" />
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/switch_case_pattern.sgrep:
--------------------------------------------------------------------------------
1 | case 5:
2 | ...
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/typed_metavar_assign.sgrep:
--------------------------------------------------------------------------------
1 | $O[($ARG : float)]
2 |
--------------------------------------------------------------------------------
/tests/patterns/json/partial_single_field2.sgrep:
--------------------------------------------------------------------------------
1 | "foo": { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/jsonnet/anonymous_metavar.jsonnet:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2
--------------------------------------------------------------------------------
/tests/patterns/jsonnet/deep_expr_operator.sgrep:
--------------------------------------------------------------------------------
1 | foo(<... 42 ...>)
--------------------------------------------------------------------------------
/tests/patterns/julia/op_plus.jl:
--------------------------------------------------------------------------------
1 | # MATCH:
2 | 1+2
3 |
4 | 1|2
5 |
--------------------------------------------------------------------------------
/tests/patterns/kotlin/metavar_cond.sgrep:
--------------------------------------------------------------------------------
1 | if ($E)
2 | foo()
3 |
--------------------------------------------------------------------------------
/tests/patterns/kotlin/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | import java.util.$X
2 |
--------------------------------------------------------------------------------
/tests/patterns/kotlin/metavar_stmt.sgrep:
--------------------------------------------------------------------------------
1 | if ($X > $Y)
2 | $S
3 |
--------------------------------------------------------------------------------
/tests/patterns/kotlin/misc_call_in_assign.sgrep:
--------------------------------------------------------------------------------
1 | $F(...).$FIELD = $VAR
--------------------------------------------------------------------------------
/tests/patterns/move_on_aptos/deep_exprstmt.sgrep:
--------------------------------------------------------------------------------
1 | foo();
2 | bar();
--------------------------------------------------------------------------------
/tests/patterns/ocaml/aliasing_qualified.sgrep:
--------------------------------------------------------------------------------
1 | AST_generic.fb $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/metavar_cond.sgrep:
--------------------------------------------------------------------------------
1 | if $E then foo else $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/metavar_func_def.sgrep:
--------------------------------------------------------------------------------
1 | let $X ... = ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/dots_args_in_block.sgrep:
--------------------------------------------------------------------------------
1 | do_something(...);
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/metavar_underscore.sgrep:
--------------------------------------------------------------------------------
1 | $_COOKIE[$VALUE]
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/named_arguments.sgrep:
--------------------------------------------------------------------------------
1 | setcookie(...,secure:true)
--------------------------------------------------------------------------------
/tests/patterns/php/naming_origname_use_group.sgrep:
--------------------------------------------------------------------------------
1 | Foo\Baz\fn_b
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/sgrep/argref.php:
--------------------------------------------------------------------------------
1 | )
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/df_input.sgrep:
--------------------------------------------------------------------------------
1 | set_password("...")
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/python/dots_inherit.sgrep:
--------------------------------------------------------------------------------
1 | class A(...):
2 | ...
3 |
--------------------------------------------------------------------------------
/tests/patterns/python/equivalence_interpolated_str.sgrep:
--------------------------------------------------------------------------------
1 | $X = "..."
--------------------------------------------------------------------------------
/tests/patterns/python/import_metavar_fullpath.sgrep:
--------------------------------------------------------------------------------
1 | import $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/import_negatives2.sgrep:
--------------------------------------------------------------------------------
1 | from foo.bar import baz
--------------------------------------------------------------------------------
/tests/patterns/python/less_inherits.sgrep:
--------------------------------------------------------------------------------
1 | class A:
2 | ...
3 |
--------------------------------------------------------------------------------
/tests/patterns/python/metavar_cond.sgrep:
--------------------------------------------------------------------------------
1 | if $E:
2 | foo()
3 |
--------------------------------------------------------------------------------
/tests/patterns/python/metavar_dict.sgrep:
--------------------------------------------------------------------------------
1 | { ..., $K: $V, ...}
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/metavar_iterator.sgrep:
--------------------------------------------------------------------------------
1 | [$X for $X in $ITERATOR]
--------------------------------------------------------------------------------
/tests/patterns/python/metavar_stmt.sgrep:
--------------------------------------------------------------------------------
1 | if var > 2:
2 | $S
3 |
--------------------------------------------------------------------------------
/tests/patterns/python/metavar_tuple.py:
--------------------------------------------------------------------------------
1 | # ERROR: match
2 | x = ()
3 |
--------------------------------------------------------------------------------
/tests/patterns/python/misc_encoded_string.sgrep:
--------------------------------------------------------------------------------
1 | url($PATH, $FUNC)
--------------------------------------------------------------------------------
/tests/patterns/python/set_vs_dict3.sgrep:
--------------------------------------------------------------------------------
1 | { ..., "foo", ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/standalone_decorator.sgrep:
--------------------------------------------------------------------------------
1 | @$NAME($...PA)
2 |
--------------------------------------------------------------------------------
/tests/patterns/python/stmts_to_fields.sgrep:
--------------------------------------------------------------------------------
1 | foo()
2 | ...
3 | bar()
--------------------------------------------------------------------------------
/tests/patterns/python/visitor_def.sgrep:
--------------------------------------------------------------------------------
1 | def __eq__(...): ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/ql/dots_predicate.sgrep:
--------------------------------------------------------------------------------
1 | predicate foo(...) { ... }
--------------------------------------------------------------------------------
/tests/patterns/ql/metavar_anno.ql:
--------------------------------------------------------------------------------
1 | // ERROR:
2 | select foo[bar](2)
--------------------------------------------------------------------------------
/tests/patterns/ruby/command_call_with_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | bar(foo ...)
--------------------------------------------------------------------------------
/tests/patterns/ruby/deep_expr_operator.sgrep:
--------------------------------------------------------------------------------
1 | foo(<... 42 ...>)
2 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/metavar_classname.sgrep:
--------------------------------------------------------------------------------
1 | class $A
2 | end
3 |
--------------------------------------------------------------------------------
/tests/patterns/ruby/misc_backtick_interp.sgrep:
--------------------------------------------------------------------------------
1 | `...#{$VAL}...`
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/metavar_class_def.sgrep:
--------------------------------------------------------------------------------
1 | struct $FOO { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/rust/metavar_cond.sgrep:
--------------------------------------------------------------------------------
1 | if ($E) {
2 | foo();
3 | }
--------------------------------------------------------------------------------
/tests/patterns/rust/metavar_func_def.sgrep:
--------------------------------------------------------------------------------
1 | fn $FOO(...) { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/scala/catch_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | try { ... } catch { ... }
--------------------------------------------------------------------------------
/tests/patterns/scala/metavar_cond.sgrep:
--------------------------------------------------------------------------------
1 | if ($E) {
2 | foo()
3 | }
--------------------------------------------------------------------------------
/tests/patterns/scala/metavar_func_def.sgrep:
--------------------------------------------------------------------------------
1 | def $FUNC(...) : $T = ...
--------------------------------------------------------------------------------
/tests/patterns/scala/metavar_pat.sgrep:
--------------------------------------------------------------------------------
1 | $X match { case $V => ... }
--------------------------------------------------------------------------------
/tests/patterns/scala/metavar_stmt.sgrep:
--------------------------------------------------------------------------------
1 | if ($E) {
2 | $S
3 | }
--------------------------------------------------------------------------------
/tests/patterns/scala/pat_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | val List(...,bad,...) = ...
--------------------------------------------------------------------------------
/tests/patterns/solidity/anonymous_metavar.sol:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 1;
--------------------------------------------------------------------------------
/tests/patterns/solidity/dots_contract.sgrep:
--------------------------------------------------------------------------------
1 | contract $C { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/solidity/misc_unchecked.sgrep:
--------------------------------------------------------------------------------
1 | unchecked { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/swift/anonymous_metavar.swift:
--------------------------------------------------------------------------------
1 |
2 | // ERROR:
3 | 2
--------------------------------------------------------------------------------
/tests/patterns/swift/if_let.swift:
--------------------------------------------------------------------------------
1 | // MATCH:
2 | if let foo = bar { }
--------------------------------------------------------------------------------
/tests/patterns/swift/semgrep_ellipsis_no_semi.sgrep:
--------------------------------------------------------------------------------
1 | foo
2 | ...
3 |
--------------------------------------------------------------------------------
/tests/patterns/swift/unbounded_range_ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | (...) + 1
2 |
--------------------------------------------------------------------------------
/tests/patterns/terraform/deep_expr_operator.sgrep:
--------------------------------------------------------------------------------
1 | foo(<... 42 ...>)
--------------------------------------------------------------------------------
/tests/patterns/ts/dots_params.sgrep:
--------------------------------------------------------------------------------
1 | function foo(...) { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/dots_type_literal.sgrep:
--------------------------------------------------------------------------------
1 | type $X = "..." | "..."
--------------------------------------------------------------------------------
/tests/patterns/ts/equivalence_decl_vs_assign.sgrep:
--------------------------------------------------------------------------------
1 | $VAR = foo();
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/import_vN.ts:
--------------------------------------------------------------------------------
1 | //ERROR:
2 | import * as v8 from "v8";
--------------------------------------------------------------------------------
/tests/patterns/ts/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | import $X from 'foo';
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/metavar_typed_expr.sgrep:
--------------------------------------------------------------------------------
1 | $A == ($B : string)
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_semicolon.ts:
--------------------------------------------------------------------------------
1 | //ERROR: match
2 | foo(5);
3 |
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_type1.sgrep:
--------------------------------------------------------------------------------
1 | let $X : number = $Y;
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_type2.sgrep:
--------------------------------------------------------------------------------
1 | function $F($X: int) { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/yaml/anonymous_metavar.yaml:
--------------------------------------------------------------------------------
1 |
2 | # ERROR:
3 | "foo"
--------------------------------------------------------------------------------
/tests/patterns/yaml/misc_other_formats_braces.sgrep:
--------------------------------------------------------------------------------
1 | hello: ...
2 |
--------------------------------------------------------------------------------
/tests/rules/vardef_assign_false1.js:
--------------------------------------------------------------------------------
1 | //OK:test
2 | var x = 1;
3 |
--------------------------------------------------------------------------------
/tests/rules/vardef_assign_true.js:
--------------------------------------------------------------------------------
1 | //ruleid:test
2 | var x = 1;
3 |
--------------------------------------------------------------------------------
/tests/rules/vardef_assign_true1.js:
--------------------------------------------------------------------------------
1 | //ruleid:test
2 | var x = 1;
3 |
--------------------------------------------------------------------------------
/tests/rules/vardef_assign_true2.js:
--------------------------------------------------------------------------------
1 | //ruleid:test
2 | var x = 1;
3 |
--------------------------------------------------------------------------------
/tests/snapshots/semgrep-core/8128ddf1251b/stdout:
--------------------------------------------------------------------------------
1 | input list: []
2 |
--------------------------------------------------------------------------------
/tests/windows/readme.txt:
--------------------------------------------------------------------------------
1 | used in build-test-windows-x86.jsonnet
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/snapshots/test_baseline/test_renamed_dir/diff.out:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/basic/simple_python_no_extension:
--------------------------------------------------------------------------------
1 | hello
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/generic/generic.txt:
--------------------------------------------------------------------------------
1 | foobar
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/monorepo/build.js:
--------------------------------------------------------------------------------
1 | bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/pnpm-error-key/foo.js:
--------------------------------------------------------------------------------
1 | bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/poetry/sca-poetry.py:
--------------------------------------------------------------------------------
1 | bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/requirement/foo.py:
--------------------------------------------------------------------------------
1 | bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/requirements/foo.py:
--------------------------------------------------------------------------------
1 | bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/dependency_aware/requirements3/foo.py:
--------------------------------------------------------------------------------
1 | bad()
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/ignores_default/ignore.min.js:
--------------------------------------------------------------------------------
1 | var x = 0 == 0
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/language-filtering/call-f.js:
--------------------------------------------------------------------------------
1 | f()
2 |
3 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/per-rule-include/dont-scan-me.py:
--------------------------------------------------------------------------------
1 | f()
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/sort-findings/b.py:
--------------------------------------------------------------------------------
1 | f()
2 | f()
3 | f()
4 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/sort-findings/c.py:
--------------------------------------------------------------------------------
1 | f()
2 | f()
3 | f()
4 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/targets/version-constraints/x.py:
--------------------------------------------------------------------------------
1 | x = "hello"
2 |
--------------------------------------------------------------------------------
/libs/parallelism/tests/Parallelism_tests.mli:
--------------------------------------------------------------------------------
1 | val tests : Testo.t list
2 |
--------------------------------------------------------------------------------
/libs/profiling/ppx/tests/basic.ml:
--------------------------------------------------------------------------------
1 | let foo a b = a + b [@@profiling]
2 |
--------------------------------------------------------------------------------
/libs/profiling/ppx/tests/label.ml:
--------------------------------------------------------------------------------
1 | let foo ~a b = a + b [@@profiling]
2 |
--------------------------------------------------------------------------------
/libs/tracing/ppx/ppx_tests/label.ml:
--------------------------------------------------------------------------------
1 | let foo ~a b = a + b [@@trace]
2 |
--------------------------------------------------------------------------------
/src/fixing/tests/Unit_autofix_printer.mli:
--------------------------------------------------------------------------------
1 | val tests : Testo.t list
2 |
--------------------------------------------------------------------------------
/src/rule/Language.mli:
--------------------------------------------------------------------------------
1 | ../../interfaces/semgrep_interfaces/Language.mli
--------------------------------------------------------------------------------
/src/spacegrep/examples/js-optional-chain.doc:
--------------------------------------------------------------------------------
1 | var x = foo?.bar?.baz;
2 |
--------------------------------------------------------------------------------
/stats/parsing-stats/test-parsing/.gitignore:
--------------------------------------------------------------------------------
1 | /run-all
2 | /run-lang
3 |
--------------------------------------------------------------------------------
/tests/TODO/protocol.sgrep:
--------------------------------------------------------------------------------
1 | $V = $F(...)
2 | ...
3 | $G(..., $V, ...)
4 |
--------------------------------------------------------------------------------
/tests/autofix/python/aligned_fix.fixed:
--------------------------------------------------------------------------------
1 | def f():
2 | foo()
3 | bar()
--------------------------------------------------------------------------------
/tests/autofix/python/aligned_fix_non_ast.py:
--------------------------------------------------------------------------------
1 | def f():
2 | to_replace()
--------------------------------------------------------------------------------
/tests/autofix/python/regexp_overcount.fix-regex:
--------------------------------------------------------------------------------
1 | A([a-z])
2 | 4
3 | [\1]
--------------------------------------------------------------------------------
/tests/jsonnet/only_envir/format.jsonnet:
--------------------------------------------------------------------------------
1 | std.format("hello %d", 12)
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/foo.txt:
--------------------------------------------------------------------------------
1 | this is a long string
2 | and it's amazing
3 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/self_as_object.jsonnet:
--------------------------------------------------------------------------------
1 | { x: 1, y: self }.y.y.x
2 |
--------------------------------------------------------------------------------
/tests/jsonnet/pass/super_up_two_levels.json:
--------------------------------------------------------------------------------
1 | { "x": 3, "y": 1, "z": 2 }
--------------------------------------------------------------------------------
/tests/login/bad_response.json:
--------------------------------------------------------------------------------
1 | {
2 | "error": "Not authorized"
3 | }
4 |
--------------------------------------------------------------------------------
/tests/misc/il/array.js:
--------------------------------------------------------------------------------
1 | function foo() {
2 | return a[1][2];
3 | }
4 |
--------------------------------------------------------------------------------
/tests/parsing/kotlin/binary-func.kt:
--------------------------------------------------------------------------------
1 | fun foo() {
2 | 2/3
3 | }
4 |
--------------------------------------------------------------------------------
/tests/parsing/kotlin/small-program.kt:
--------------------------------------------------------------------------------
1 | fun foo() {
2 | 2
3 | }
4 |
--------------------------------------------------------------------------------
/tests/parsing_errors/err.ts:
--------------------------------------------------------------------------------
1 | function foo() {
2 | return 1+
3 | }
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/deep_expr_operator.sgrep:
--------------------------------------------------------------------------------
1 | foo(<... 42 ...>);
2 |
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/metavar_stmt.sgrep:
--------------------------------------------------------------------------------
1 | if ($X > $Y)
2 | $S;
3 |
--------------------------------------------------------------------------------
/tests/patterns/POLYGLOT/regexp_pcre.sgrep:
--------------------------------------------------------------------------------
1 | $X = "=~/[A-Fa-f0-9]{16}/"
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/command-substitution.bash:
--------------------------------------------------------------------------------
1 | # MATCH:
2 | echo $(ls)
3 |
--------------------------------------------------------------------------------
/tests/patterns/bash/concatenation-ellipsis.bash:
--------------------------------------------------------------------------------
1 | # MATCH:
2 | a${x}c
3 |
--------------------------------------------------------------------------------
/tests/patterns/bash/declaration-assignments.sgrep:
--------------------------------------------------------------------------------
1 | declare -r $VAR=...
2 |
--------------------------------------------------------------------------------
/tests/patterns/bash/dots_stmts.sgrep:
--------------------------------------------------------------------------------
1 | $V=$(cat)
2 | ...
3 | eval ${$V}
4 |
--------------------------------------------------------------------------------
/tests/patterns/bash/nested_stmts.sgrep:
--------------------------------------------------------------------------------
1 | if ...; then
2 | ...
3 | fi
4 |
--------------------------------------------------------------------------------
/tests/patterns/bash/todo/var-ellipsis-var.sgrep:
--------------------------------------------------------------------------------
1 | # MATCH:
2 | $A...$B
3 |
--------------------------------------------------------------------------------
/tests/patterns/c/metavar_typed_generic.sgrep:
--------------------------------------------------------------------------------
1 | ($T *$X) == ($T *$Y)
2 |
--------------------------------------------------------------------------------
/tests/patterns/cairo/metavar_stmt.sgrep:
--------------------------------------------------------------------------------
1 | if $X > $Y {
2 | $S;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/patterns/cairo/misc_impl.sgrep:
--------------------------------------------------------------------------------
1 | impl UnsafeType of $USERTYPE {}
2 |
--------------------------------------------------------------------------------
/tests/patterns/cpp/misc_const.sgrep:
--------------------------------------------------------------------------------
1 | const $TYPE $VARIABLE = $VALUE;
2 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/decl_before_init.sgrep:
--------------------------------------------------------------------------------
1 | (IFoobar $F).Find(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_anno.sgrep:
--------------------------------------------------------------------------------
1 | [$ANNO]
2 | class $CLASS{ ... }
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_ellipsis_new_args.sgrep:
--------------------------------------------------------------------------------
1 | new C($...ARGS)
2 |
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_func_def.sgrep:
--------------------------------------------------------------------------------
1 | $RETURNTYPE $FUNC(...) {...}
--------------------------------------------------------------------------------
/tests/patterns/csharp/metavar_stmt.sgrep:
--------------------------------------------------------------------------------
1 | if ($E) {
2 | $S;
3 | }
4 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/arg-default-metavar.sgrep:
--------------------------------------------------------------------------------
1 | ARG $VAR=$VAL
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/copy-param.sgrep:
--------------------------------------------------------------------------------
1 | COPY file1 file2 /mydir/
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/entrypoint-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | ENTRYPOINT ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/expose-metavar.sgrep:
--------------------------------------------------------------------------------
1 | EXPOSE $PORT_PROTO
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/healthcheck-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | HEALTHCHECK ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/healthcheck-none.sgrep:
--------------------------------------------------------------------------------
1 | HEALTHCHECK NONE
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/label-variable-key.sgrep:
--------------------------------------------------------------------------------
1 | LABEL $X=value
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/run-param-metavar.sgrep:
--------------------------------------------------------------------------------
1 | RUN --foo=$FOO echo
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/run-param.sgrep:
--------------------------------------------------------------------------------
1 | RUN --mount=type=secret ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/stopsignal-metavar.sgrep:
--------------------------------------------------------------------------------
1 | STOPSIGNAL $SIGNAL
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/user-group-metavar.sgrep:
--------------------------------------------------------------------------------
1 | USER $USER:$GROUP
2 |
--------------------------------------------------------------------------------
/tests/patterns/dockerfile/workdir-metavar.sgrep:
--------------------------------------------------------------------------------
1 | WORKDIR /home/$DIR
2 |
--------------------------------------------------------------------------------
/tests/patterns/generic/dots_args.sgrep:
--------------------------------------------------------------------------------
1 | foo(
2 | ... 5 ...
3 | )
4 |
--------------------------------------------------------------------------------
/tests/patterns/generic/metavar_stmt.sgrep:
--------------------------------------------------------------------------------
1 | if ($X > $Y)
2 | ...;
3 |
--------------------------------------------------------------------------------
/tests/patterns/go/dots_params.sgrep:
--------------------------------------------------------------------------------
1 | func $F(...) {
2 | ...
3 | }
4 |
--------------------------------------------------------------------------------
/tests/patterns/go/equivalence_constant_dataflow.sgrep.TODO:
--------------------------------------------------------------------------------
1 | $f("password")
--------------------------------------------------------------------------------
/tests/patterns/go/equivalence_naming_import.sgrep:
--------------------------------------------------------------------------------
1 | subprocess.open(...)
--------------------------------------------------------------------------------
/tests/patterns/go/equivalence_naming_import2.sgrep:
--------------------------------------------------------------------------------
1 | youtube.BAD_CONST
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/metavar_typed_lefthand.sgrep:
--------------------------------------------------------------------------------
1 | ($A : [5]person) = $B
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/metavar_typed_literal.sgrep:
--------------------------------------------------------------------------------
1 | $KEY = ($VAL : string)
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/misc_assignop.sgrep:
--------------------------------------------------------------------------------
1 | if $A, $B := ... ; $B { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/misc_tuple_order.sgrep:
--------------------------------------------------------------------------------
1 | if $A, $B = ... ; $A { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/go/partial_initbraces.sgrep:
--------------------------------------------------------------------------------
1 | {..., OK: $VALUE, ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/hack/dots_params.sgrep:
--------------------------------------------------------------------------------
1 | function foo(..., $var) {
2 | }
3 |
--------------------------------------------------------------------------------
/tests/patterns/hack/metavar_cond.sgrep:
--------------------------------------------------------------------------------
1 | if ($E) {
2 | foo();
3 | }
4 |
--------------------------------------------------------------------------------
/tests/patterns/java/aliasing_and_direct.sgrep:
--------------------------------------------------------------------------------
1 | @Attr
2 | class $FOO
3 |
--------------------------------------------------------------------------------
/tests/patterns/java/dots_enum.sgrep:
--------------------------------------------------------------------------------
1 | @foo
2 | enum $A { ... }
3 |
4 |
--------------------------------------------------------------------------------
/tests/patterns/java/equivalence_constant_propagation.sgrep:
--------------------------------------------------------------------------------
1 | foo("password")
--------------------------------------------------------------------------------
/tests/patterns/java/errors/recoverable_error1.java:
--------------------------------------------------------------------------------
1 | class X {
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_typed_classfield.sgrep:
--------------------------------------------------------------------------------
1 | check((int $X))
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_typed_field.sgrep:
--------------------------------------------------------------------------------
1 | check((FooType $X))
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/metavar_typed_lefthand.sgrep:
--------------------------------------------------------------------------------
1 | (Bar[] $A) = $B;
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/misc_import_static.sgrep:
--------------------------------------------------------------------------------
1 | import static $CLASS;
2 |
--------------------------------------------------------------------------------
/tests/patterns/java/parameterized_type.sgrep:
--------------------------------------------------------------------------------
1 | new SpecificDatumReader(...)
--------------------------------------------------------------------------------
/tests/patterns/java/try_resources.sgrep:
--------------------------------------------------------------------------------
1 | HttpClients.createDefault()
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/aliasing_require.sgrep:
--------------------------------------------------------------------------------
1 | child_process.execSync(...)
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/deep_cond.sgrep:
--------------------------------------------------------------------------------
1 | if(<... $X = true ...>)
2 | ...
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/deep_expr_vs_statement.sgrep:
--------------------------------------------------------------------------------
1 | <... a ...>;
2 | b
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_importfrom.sgrep:
--------------------------------------------------------------------------------
1 | import jwt_decode from "..."
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_object.sgrep:
--------------------------------------------------------------------------------
1 | var X = {..., secure:false, ...};
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_regexp.js:
--------------------------------------------------------------------------------
1 | //ERROR: match
2 | const x = /abc/;
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/dots_template_literals.sgrep:
--------------------------------------------------------------------------------
1 | $X = `...${...}...`
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/equivalence_constant_propagation2.sgrep:
--------------------------------------------------------------------------------
1 | api("...")
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/equivalence_constant_propagation3.sgrep:
--------------------------------------------------------------------------------
1 | $X === $X
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/equivalence_keyword_args.sgrep:
--------------------------------------------------------------------------------
1 | foo({kwd2:$X, kwd1:$Y})
--------------------------------------------------------------------------------
/tests/patterns/js/metavar_importfrom.sgrep:
--------------------------------------------------------------------------------
1 | import jwt_decode from $X;
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/metavar_typed_literal.sgrep:
--------------------------------------------------------------------------------
1 | func(($VAL: number))
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_faketok.sgrep:
--------------------------------------------------------------------------------
1 | $REQUEST(..., $REQ, ...)
2 |
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_new.js:
--------------------------------------------------------------------------------
1 | //ERROR: match
2 | var x = new A(1);
3 |
--------------------------------------------------------------------------------
/tests/patterns/js/misc_this.sgrep:
--------------------------------------------------------------------------------
1 | var $URL = $THIS.request.params;
2 |
--------------------------------------------------------------------------------
/tests/patterns/js/partial_single_field.sgrep:
--------------------------------------------------------------------------------
1 | dependencies: { ... }
2 |
--------------------------------------------------------------------------------
/tests/patterns/json/metavar_array.sgrep:
--------------------------------------------------------------------------------
1 | { "key": $V, "var": [ ... ] }
2 |
--------------------------------------------------------------------------------
/tests/patterns/julia/dots_nested_stmts.sgrep:
--------------------------------------------------------------------------------
1 | if ...
2 | ...
3 | end
4 |
--------------------------------------------------------------------------------
/tests/patterns/move_on_sui/deep_expr_operator.sgrep:
--------------------------------------------------------------------------------
1 | foo(<... 42 ...>)
2 |
--------------------------------------------------------------------------------
/tests/patterns/move_on_sui/metavar_anno.sgrep:
--------------------------------------------------------------------------------
1 | fun $SOME_FUN(...) : ...
--------------------------------------------------------------------------------
/tests/patterns/move_on_sui/metavar_import.sgrep:
--------------------------------------------------------------------------------
1 | use std::object::{$MEM1};
--------------------------------------------------------------------------------
/tests/patterns/ocaml/dots_nested_stmts.sgrep:
--------------------------------------------------------------------------------
1 | if ... then ... else ...
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/metavar_stmt.sgrep:
--------------------------------------------------------------------------------
1 | if $X > $Y then $S else $M
2 |
--------------------------------------------------------------------------------
/tests/patterns/ocaml/misc_useless_else.sgrep:
--------------------------------------------------------------------------------
1 | if $E then $E2 else ()
2 |
--------------------------------------------------------------------------------
/tests/patterns/php/dots_echo.php:
--------------------------------------------------------------------------------
1 | $VALUE, ...)
--------------------------------------------------------------------------------
/tests/patterns/swift/dots_nested_stmts.sgrep:
--------------------------------------------------------------------------------
1 | if ... {
2 | ...
3 | }
4 |
--------------------------------------------------------------------------------
/tests/patterns/ts/deep_record.sgrep:
--------------------------------------------------------------------------------
1 | return <... location.href ...>
2 |
--------------------------------------------------------------------------------
/tests/patterns/ts/misc_function.sgrep:
--------------------------------------------------------------------------------
1 | function foo() {
2 | ...
3 | }
4 |
--------------------------------------------------------------------------------
/tests/patterns/ts/record_functions.sgrep:
--------------------------------------------------------------------------------
1 | foo({
2 | $THING: ...
3 | })
--------------------------------------------------------------------------------
/tests/patterns/yaml/metavar_field.yaml:
--------------------------------------------------------------------------------
1 | #ERROR: match
2 | - name: Emma
3 |
--------------------------------------------------------------------------------
/tests/perf/bloom/stmts-mv-ellipsis.sgrep:
--------------------------------------------------------------------------------
1 | $A;
2 | ...
3 | foo($A);
4 |
--------------------------------------------------------------------------------
/tests/rules/xml_metavar_comp2.xml:
--------------------------------------------------------------------------------
1 |
2 | 20
3 |
--------------------------------------------------------------------------------
/tests/snapshots/semgrep-core/2e75b85cd1f4/name:
--------------------------------------------------------------------------------
1 | Gitignore > unanchored
2 |
--------------------------------------------------------------------------------
/cli/tests/default/e2e/snapshots/test_baseline/test_unstaged_changes/output.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------