Skip to content

Commit

Permalink
feat: also allow modules for metavariable-name
Browse files Browse the repository at this point in the history
Similar to `type` and `types`, extends the existing support for `module`
to also allow for `modules`.
  • Loading branch information
kopecs committed Oct 7, 2024
1 parent 724cfcc commit 9d4d17e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions rule_schema_v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -659,15 +659,23 @@ $defs:
title: Kind keyword
type: string
module:
title: Kind keyword
title: A module name
type: string
modules:
title: A list of module names
type: array
items:
type: string
required:
- metavariable
anyOf:
- required:
- kind
- required:
- module
- oneOf:
- required:
- module
- required:
- modules
additionalProperties: false
required:
- semgrep-internal-metavariable-name
Expand Down
1 change: 1 addition & 0 deletions rule_schema_v2.atd
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ type metavariable_cond = {
?kind: string option;
(* for semgrep-internal-metavariable-name; consider renaming? for v2 *)
?module_ <json name="module">: string option;
?modules: string list option;

(* this covers regex:/pattern:, but also all:/any: with optional where:
* CHECK: language is valid only when combined with a formula
Expand Down

0 comments on commit 9d4d17e

Please sign in to comment.