Detects specified patterns in files
How to enable
Add the following to your
# .sourcelevel.yml engines: grep: enabled: true
Want to know how to specify
channel for your reviews? Check
configuration instructions page.
You can configure which patterns you want to detect with
grep through your
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:
patternthe pattern to look for. The engine uses GNU Extended Regular Expression syntax for patterns. Keep in mind that YAML uses backslash (
\) as an escape opener. You may need to escape backslash (
\\) if you use it in your pattern. Consult YAML spec Escape Characters section for details.
annotationis the issue description.
You can also use the following properties to further configure how the pattern is detected and reported:
categoriesis a list of categories this issue falls into. Maybe a string if you want to specify only one category. Possible vallues are
Style. Defaults to
path_patternsis a list of file path patterns (in shell glob syntax) to limit files this match is applied to.