Cleanup rubocop-cask references.
This commit is contained in:
parent
ec3e7b2ae5
commit
109e974c38
@ -20,7 +20,7 @@ module Cask
|
||||
def install_rubocop
|
||||
capture_stderr do
|
||||
begin
|
||||
Homebrew.install_gem_setup_path! "rubocop-cask", HOMEBREW_RUBOCOP_CASK_VERSION, "rubocop"
|
||||
Homebrew.install_gem_setup_path! "rubocop"
|
||||
rescue SystemExit
|
||||
raise CaskError, Tty.strip_ansi($stderr.string).chomp.sub(/\AError: /, "")
|
||||
end
|
||||
@ -43,8 +43,8 @@ module Cask
|
||||
|
||||
def default_args
|
||||
[
|
||||
"--require", "rubocop-cask",
|
||||
"--force-default-config",
|
||||
"--force-exclusion",
|
||||
"--config", "#{HOMEBREW_LIBRARY}/.rubocop.yml",
|
||||
"--format", "simple"
|
||||
]
|
||||
end
|
||||
|
@ -1,5 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# RuboCop version used for `brew style` and `brew cask style`
|
||||
HOMEBREW_RUBOCOP_VERSION = "0.60.0"
|
||||
HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.23.0" # has to be updated when RuboCop version changes
|
@ -151,7 +151,6 @@ require "active_support/core_ext/object/blank"
|
||||
require "active_support/core_ext/hash/deep_merge"
|
||||
require "active_support/core_ext/file/atomic"
|
||||
|
||||
require "constants"
|
||||
require "exceptions"
|
||||
require "utils"
|
||||
|
||||
|
@ -104,7 +104,7 @@ graphical user interface.
|
||||
Ruby regular expression.
|
||||
|
||||
* `style` [--fix] [ <token> ... ]:
|
||||
Check the given Casks for correct style using [RuboCop Cask](https://github.com/Homebrew/rubocop-cask).
|
||||
Check the given Casks for correct style using RuboCop (with custom Cask cops).
|
||||
If no tokens are given on the command line, all Casks are checked.
|
||||
With `--fix`, auto-correct any style errors if possible.
|
||||
|
||||
|
@ -17,7 +17,7 @@ module Homebrew
|
||||
def check_style_impl(files, output_type, options = {})
|
||||
fix = options[:fix]
|
||||
|
||||
Homebrew.install_gem_setup_path! "rubocop", HOMEBREW_RUBOCOP_VERSION
|
||||
Homebrew.install_gem_setup_path! "rubocop"
|
||||
Homebrew.install_gem! "rubocop-rspec"
|
||||
require "rubocop"
|
||||
require "rubocops"
|
||||
@ -80,11 +80,11 @@ module Homebrew
|
||||
args << "--debug" if ARGV.debug?
|
||||
args << "--display-cop-names" if ARGV.include? "--display-cop-names"
|
||||
args << "--format" << "simple" if files
|
||||
system(cache_env, "rubocop", "_#{HOMEBREW_RUBOCOP_VERSION}_", *args)
|
||||
system(cache_env, "rubocop", *args)
|
||||
rubocop_success = $CHILD_STATUS.success?
|
||||
when :json
|
||||
json, err, status =
|
||||
Open3.capture3(cache_env, "rubocop", "_#{HOMEBREW_RUBOCOP_VERSION}_",
|
||||
Open3.capture3(cache_env, "rubocop",
|
||||
"--format", "json", *args)
|
||||
# exit status of 1 just means violations were found; other numbers mean
|
||||
# execution errors.
|
||||
|
@ -1,13 +1,11 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
require_relative "../constants"
|
||||
|
||||
gem "parallel_tests"
|
||||
gem "rspec"
|
||||
gem "rspec-its", require: false
|
||||
gem "rspec-retry", require: false
|
||||
gem "rspec-wait", require: false
|
||||
gem "rubocop", HOMEBREW_RUBOCOP_VERSION
|
||||
gem "rubocop"
|
||||
|
||||
group :development do
|
||||
gem "ronn", require: false
|
||||
|
@ -74,7 +74,7 @@ DEPENDENCIES
|
||||
rspec-its
|
||||
rspec-retry
|
||||
rspec-wait
|
||||
rubocop (= 0.60.0)
|
||||
rubocop
|
||||
simplecov
|
||||
simplecov-cobertura
|
||||
|
||||
|
@ -59,21 +59,6 @@ describe Cask::Cmd::Style, :cask do
|
||||
expect { subject }.to raise_error(Cask::CaskError)
|
||||
end
|
||||
end
|
||||
|
||||
specify "`rubocop-cask` supports `HOMEBREW_RUBOCOP_VERSION`", :needs_network do
|
||||
stdout, status = Open3.capture2(
|
||||
"gem", "dependency", "rubocop-cask",
|
||||
"--version", HOMEBREW_RUBOCOP_CASK_VERSION, "--pipe", "--remote"
|
||||
)
|
||||
|
||||
expect(status).to be_a_success
|
||||
|
||||
requirement = Gem::Requirement.new(stdout.scan(/rubocop --version '(.*)'/).flatten.first)
|
||||
version = Gem::Version.new(HOMEBREW_RUBOCOP_VERSION)
|
||||
|
||||
expect(requirement).not_to be_none
|
||||
expect(requirement).to be_satisfied_by(version)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#cask_paths" do
|
||||
@ -150,7 +135,7 @@ describe Cask::Cmd::Style, :cask do
|
||||
describe "#default_args" do
|
||||
subject { cli.default_args }
|
||||
|
||||
it { is_expected.to include("--require", "rubocop-cask", "--format", "simple") }
|
||||
it { is_expected.to include("--format", "simple") }
|
||||
end
|
||||
|
||||
describe "#autocorrect_args" do
|
||||
|
@ -104,7 +104,7 @@ Without an argument, display all locally available Casks for install; no online
|
||||
.
|
||||
.TP
|
||||
\fBstyle\fR [\-\-fix] [ \fItoken\fR \.\.\. ]
|
||||
Check the given Casks for correct style using RuboCop Cask \fIhttps://github\.com/Homebrew/rubocop\-cask\fR\. If no tokens are given on the command line, all Casks are checked\. With \fB\-\-fix\fR, auto\-correct any style errors if possible\.
|
||||
Check the given Casks for correct style using RuboCop (with custom Cask cops)\. If no tokens are given on the command line, all Casks are checked\. With \fB\-\-fix\fR, auto\-correct any style errors if possible\.
|
||||
.
|
||||
.TP
|
||||
\fBuninstall\fR or \fBrm\fR or \fBremove\fR [\-\-force] \fItoken\fR [ \fItoken\fR \.\.\. ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user