Giter Club home page Giter Club logo

codeclimate-grep's Introduction

Code Climate Grep Engine

Code Climate

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

Example config:

engines:
  grep:
    enabled: true
    config:
      patterns:
        no-set-methods:
          pattern: def set_\w+
          matcher: extended
          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.

matcher is an optional entry, defaults to extended. Determines the matcher type to be use by grep. The options match those supported by grep, being;

  • extended for --extended-regexp
  • fixed for --fixed-strings
  • basic for --basic-regexp
  • perl for --perl-regexp

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.

codeclimate-grep's People

Contributors

fede-moya avatar gdiggs avatar pointlessone avatar zramsay avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.