grep

Searches any given input files, selecting lines that match one or more patterns.

Version

grep (GNU grep) 2.27

Runtime

Alpine Linux 3.5

Supported Languages

All Languages

Official Documentation

https://www.gnu.org/software/grep/

YAML Configuration

grep:

  • input:

    Patterns to include in execution and reports.

  • ignore:

    Patterns to exclude from execution and reports.

  • auto-fix:

    N/A

  • config-file:

    N/A

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.25 CPU with 960 MiB RAM.

  • options:

    Below is the list of options that are supported:

    Regexp selection and interpretation:
      -E, --extended-regexp     PATTERN is an extended regular expression (ERE)
      -F, --fixed-strings       PATTERN is a set of newline-separated strings
      -G, --basic-regexp        PATTERN is a basic regular expression (BRE)
      -P, --perl-regexp         PATTERN is a Perl regular expression
      -e, --regexp=PATTERN      use PATTERN for matching
      -f, --file=FILE           obtain PATTERN from FILE
      -i, --ignore-case         ignore case distinctions
      -w, --word-regexp         force PATTERN to match only whole words
      -x, --line-regexp         force PATTERN to match only whole lines
    
    Miscellaneous:
      -v, --invert-match        select non-matching lines
    
    Output control:
      -m, --max-count=NUM       stop after NUM matches
      -o, --only-matching       show only the part of a line matching PATTERN
          --binary-files=TYPE   assume that binary files are TYPE;
                                TYPE is 'binary', 'text', or 'without-match'
      -a, --text                equivalent to --binary-files=text
      -I                        equivalent to --binary-files=without-match
      -R, --dereference-recursive  likewise, but follow all symlinks
          --include=FILE_PATTERN  search only files that match FILE_PATTERN
          --exclude=FILE_PATTERN  skip files and directories matching FILE_PATTERN
          --exclude-from=FILE   skip files matching any file pattern from FILE
  • experimental:

    • incremental:

      true/false

      Note: The incremental analysis is disabled if any kinds of configuration files are changed. The files recognized as configuration files are as follows:

      • Pattern files:

        • Files specified to -f, --file options
      • Exclude files:

        • Files specified to --exclude-from option

YAML Examples

  • With default options:

    inspecode:
      grep: default

    By default, BUG:\|FIXME:\|HACK:\|TODO:\|XXX: is specified to --regexp option.

  • With custom machine:

    inspecode:
      grep:
        machine:
          cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
  • With custom options:

    inspecode:
      grep:
        options:
          - --line-regexp
          - --regexp: pattern for whole lines

results matching ""

    No results matching ""