Home

Awesome

CircleCI

Danger Rubocop

A Danger plugin for Rubocop (and compatible wrappers such as Standard).

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

Submit comments only for changed lines

github.dismiss_out_of_range_messages
rubocop.lint inline_comment: true

Format using standardrb instead of Rubocop

rubocop.lint rubocop_cmd: 'standardrb'

Methods

lint(config: Hash)

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

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

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

License

MIT