Detects specified patterns in files

How to enable grep

Add the following to your .sourcelevel.yml file.

# .sourcelevel.yml
engines:
  grep:
    enabled: true

Available channels

Want to know how to specify channel for your reviews? Check configuration instructions page.


Detecting patterns

You can configure which patterns you want to detect with grep through your .sourcelevel.yml file:

engines:
  grep:
    enabled: true
    config:
      patterns:
        no-set-methods:
          pattern: def get_\w+
          annotation: "Don't define methods that start with `get_`"
          path_patterns:
            - "**/*.rb"

patterns is a dictionary of patterns you want to detect and report as issues. keys are the issue’s check name and values are the pattern configuration. The configuration must include the following properties:

You can also use the following properties to further configure how the pattern is detected and reported:

Need more help? Feel free to contact us via email. or chat.