GithubHelp home page GithubHelp logo

danger-rubocop's Introduction

CircleCI

Danger Rubocop

A Danger plugin for Rubocop.

Installation

Add this line to your Gemfile:

gem 'danger-rubocop'

Usage

Run Ruby files through Rubocop. Results are passed out as a table in markdown.

Specifying custom config file.

rubocop.lint

Lint specific files in a folder, when they change

public_files = (git.modified_files + git.added_files).select { |path| path.include?("/public/") }
rubocop.lint public_files

Methods

lint(config: Hash)

Runs Ruby files through Rubocop. Generates a markdown list of warnings.

This method accepts configuration hash. The following keys are supported:

  • files: array of file names or glob patterns to determine files to lint
  • force_exclusion: pass true to pass --force-exclusion argument to Rubocop. (this option will instruct rubocop to ignore the files that your rubocop config ignores, despite the plugin providing the list of files explicitely)
  • inline_comment: pass true to comment inline of the diffs.
  • fail_on_inline_comment: pass true to use fail instead of warn on inline comment.
  • report_danger: pass true to report errors to Danger, and break CI.
  • config: path to the .rubocop.yml file.

Passing files as only argument is also supported for backward compatibility.

License

MIT

danger-rubocop's People

Contributors

ashfurrow avatar bastes avatar edvakf avatar javierg avatar mrardon avatar nikolaykasyanov avatar orta avatar phansch avatar prokopsimek avatar r7kamura avatar segiddins avatar timriley 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.