codeclimate/codeclimate-grep

Name: codeclimate-grep

Owner: Code Climate

Description: null

Created: 2017-03-23 17:20:56.0

Updated: 2017-11-17 20:05:36.0

Pushed: 2017-10-18 11:39:17.0

Homepage: null

Size: 18

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Code Climate Grep Engine

Code Climate

codeclimate-grep is a Code Climate engine that finds specified text and gives a message.

Example config:

nes:
ep:
enabled: true
config:
  patterns:
    no-set-methods:
      pattern: def set_\w+
      annotation: "Don't define methods that start with `set_`"
      severity: minor
      categories: Bug Risk
      content: >
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc id
        urna eget libero fermentum bibendum. Duis dapibus, neque vel aliquet
        tincidunt, diam eros tempor neque
      path_patterns:
        - "**/*.rb"

patterns is a list of match configurations. Each key in it is an issue's check name. Values are individual match configurations.

pattern is a required entry. It's a pattern to look for. This 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.

annotation is a required entry. It's the issue description.

severity is an optional entry, default is minor. Possible values are info, minor, major, critical, or blocker.

categories is an optional entry, defaults to ["Bug Risk"]. It's a list of categories this issue falls into. Maybe a string if you want to specify only one category. Possible vallues are Bug Risk, Clarity, Compatibility, Complexity, Duplication, Performance, Security, and Style.

content is an optional entry. It's an extended description of the issue.

path\_patterns is an optional entry, defaults to all scannable files. It's a list of file path patterns (in shell glob syntax) to limit files this match is applied to. This patterns are used as a filter agains include\_paths.

Installation
  1. If you haven't already, install the Code Climate CLI.
  2. Run codeclimate engines:enable grep. This command both installs the engine and enables it in your .codeclimate.yml file.
  3. Edit your .codeclimate.yml and add patterns and message.
  4. You're ready to analyze! Browse into your project's folder and run codeclimate analyze.
Need help?

If you're running into a Code Climate issue, first look over this project's GitHub Issues, as your question may have already been covered. If not, go ahead and open a support ticket with us.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.