reference Rule options

generic_ellipsis_max_span

Value
an integer
Default
10

With languages: [generic] and the default engine, spacegrep, an ellipsis ... matches at most this many line breaks. 0 keeps each match of ... within one line.

The option has no effect with generic_engine: aliengrep, whose ellipsis is limited by generic_multiline instead.

Examples

Blocks within one line

The rule block keeps its ellipsis within a line.

blocks.yaml
rules:  - id: block-default    pattern: begin ... end    message: a block    languages: [generic]    severity: INFO  - id: block    pattern: begin ... end    message: a block    languages: [generic]    severity: INFO    options:      generic_ellipsis_max_span: 0
blocks.txt
begin x endbeginxend
Command and result
$ opengrep scan -q --config blocks.yaml blocks.txt
blocks.txt

  info  block
  a block

     1: begin x end

  info  block-default
  a block

     1: begin x end

     2: begin
     3: x
     4: end