diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 5a050d1cd0911b1fca024c1c4bb5db416459fe1f..163d43e8879be00489a84e81a17334e750eaab98 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -11,8 +11,6 @@ #: 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. diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index bbfee6cf33bd79abcd69b3e3b10f4ec429be77cd..ca95138c051a615bd408016968e829a2baf3a524 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -18,10 +18,12 @@ module Homebrew fix = options[:fix] Homebrew.install_gem_setup_path! "rubocop", HOMEBREW_RUBOCOP_VERSION + Homebrew.install_gem! "rubocop-rspec" require "rubocop" require "rubocops" args = %w[ + --require rubocop-rspec --force-exclusion ] if fix @@ -34,11 +36,6 @@ module Homebrew args += ["--extra-details", "--display-cop-names"] 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| @@ -65,11 +62,7 @@ module Homebrew File.expand_path(file).start_with? HOMEBREW_LIBRARY_PATH end config_file = if files.nil? || has_non_formula - if ARGV.include?("--rspec") - HOMEBREW_LIBRARY_PATH/".rubocop-rspec.yml" - else - HOMEBREW_LIBRARY_PATH/".rubocop.yml" - end + HOMEBREW_LIBRARY_PATH/".rubocop.yml" else HOMEBREW_LIBRARY/".rubocop_audit.yml" end diff --git a/Library/Homebrew/test/Gemfile b/Library/Homebrew/test/Gemfile index b9ef330917307d2f1a49ba83beaf3657e6a28216..f19f6b1f187428b54a91b08636e6a08e106a88ed 100644 --- a/Library/Homebrew/test/Gemfile +++ b/Library/Homebrew/test/Gemfile @@ -8,6 +8,7 @@ gem "rspec-its", require: false gem "rspec-retry", require: false gem "rspec-wait", require: false gem "rubocop", HOMEBREW_RUBOCOP_VERSION +gem "rubocop-rspec", require: false group :development do gem "ronn", require: false diff --git a/Library/Homebrew/test/Gemfile.lock b/Library/Homebrew/test/Gemfile.lock index 182be5c13e401c0f400428bde644636edc710bc9..ccc48f5a23d2b86c9c21ea2010bf8eaf209f6e56 100644 --- a/Library/Homebrew/test/Gemfile.lock +++ b/Library/Homebrew/test/Gemfile.lock @@ -52,6 +52,8 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) + rubocop-rspec (1.29.1) + rubocop (>= 0.58.0) ruby-progressbar (1.10.0) simplecov (0.16.1) docile (~> 1.1) @@ -73,6 +75,7 @@ DEPENDENCIES rspec-retry rspec-wait rubocop (= 0.59.1) + rubocop-rspec simplecov BUNDLED WITH diff --git a/Library/Homebrew/test/diagnostic_spec.rb b/Library/Homebrew/test/diagnostic_checks_spec.rb similarity index 100% rename from Library/Homebrew/test/diagnostic_spec.rb rename to Library/Homebrew/test/diagnostic_checks_spec.rb diff --git a/docs/Manpage.md b/docs/Manpage.md index 8491b4f994cdeaac50ae684b3a501d653d12d857..a1e5a0af6a38ab0352bc39c6d3687ecbad1be8a2 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -464,8 +464,6 @@ 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. diff --git a/manpages/brew.1 b/manpages/brew.1 index 4bdb2893500c5a50bdd07a699ec285fef594c257..62a643b1927347673364678a6d014410b1d7d7db 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -425,9 +425,6 @@ 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