Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: also allow modules for metavariable-name #295

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this one!


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