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.lintLint specific files in a folder, when they change
public_files = (git.modified_files + git.added_files).select { |path| path.include?("/public/") }
rubocop.lint public_filesSubmit comments only for changed lines
github.dismiss_out_of_range_messages
rubocop.lint inline_comment: truelint(config: Hash)
Runs Ruby files through Rubocop. Generates a markdown list of warnings.
This method accepts a configuration hash. The following keys are supported:
files: array of file names or glob patterns to determine files to lintforce_exclusion: passtrueto pass--force-exclusionargument 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: passtrueto comment inline of the diffs.fail_on_inline_comment: passtrueto usefailinstead ofwarnon inline comment.report_danger: pass true to report errors to Danger, and break CI.config: path to the.rubocop.ymlfile.only_report_new_offenses: passtrueto only report offenses that are in current user's scope. Note that this won't mark offenses for Metrics/XXXLength if you add lines to an already existing scope.include_cop_names: Prepends cop names to the output messages. Example: "Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end."
Passing files as only argument is also supported for backward compatibility.
MIT