Add this line to your Gemfile:
gem 'danger-rubocop'
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
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 lintforce_exclusion
: passtrue
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
: passtrue
to comment inline of the diffs.fail_on_inline_comment
: passtrue
to usefail
instead ofwarn
on inline comment.report_danger
: pass true to report errors to Danger, and break CI.
Passing files
as only argument is also supported for backward compatibility.
MIT