Merge pull request #3982 from MikeMcQuaid/rubocop-rspec

style: add optional rubocop-rspec support.
This commit is contained in:
Mike McQuaid 2018-03-28 11:21:56 +01:00 committed by GitHub
commit dda1dd54eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -11,6 +11,8 @@
#: If `--display-cop-names` is passed, include the RuboCop cop name for each
#: violation in the output.
#:
#: If `--rspec` is passed, install and use the RuboCop RSpec gem.
#:
#: Passing `--only-cops=`<cops> will check for violations of only the listed
#: RuboCop <cops>, while `--except-cops=`<cops> will skip checking the listed
#: <cops>. For either option <cops> should be a comma-separated list of cop names.
@ -83,6 +85,11 @@ module Homebrew
args << "--parallel"
end
if ARGV.include?("--rspec")
Homebrew.install_gem! "rubocop-rspec"
args += %w[--require rubocop-rspec]
end
if options[:except_cops]
options[:except_cops].map! { |cop| RuboCop::Cop::Cop.registry.qualified_cop_name(cop.to_s, "") }
cops_to_exclude = options[:except_cops].select do |cop|

View File

@ -436,6 +436,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--display-cop-names` is passed, include the RuboCop cop name for each
violation in the output.
If `--rspec` is passed, install and use the RuboCop RSpec gem.
Passing `--only-cops=``cops` will check for violations of only the listed
RuboCop `cops`, while `--except-cops=``cops` will skip checking the listed
`cops`. For either option `cops` should be a comma-separated list of cop names.

View File

@ -446,6 +446,9 @@ If \fB\-\-fix\fR is passed, automatically fix style violations using RuboCop\'s
If \fB\-\-display\-cop\-names\fR is passed, include the RuboCop cop name for each violation in the output\.
.
.IP
If \fB\-\-rspec\fR is passed, install and use the RuboCop RSpec gem\.
.
.IP
Passing \fB\-\-only\-cops=\fR\fIcops\fR will check for violations of only the listed RuboCop \fIcops\fR, while \fB\-\-except\-cops=\fR\fIcops\fR will skip checking the listed \fIcops\fR\. For either option \fIcops\fR should be a comma\-separated list of cop names\.
.
.IP