Skip to content

Commit

Permalink
Merge pull request #3740 from reitermarkus/cask-style
Browse files Browse the repository at this point in the history
Fix `brew cask style` on Travis.
  • Loading branch information
reitermarkus committed Jan 28, 2018
2 parents 5244755 + 884c57f commit 9f4b4a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Library/Homebrew/cask/lib/hbc/cli/style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def self.help
def run
install_rubocop
cache_env = { "XDG_CACHE_HOME" => "#{HOMEBREW_CACHE}/style" }
system(cache_env, "rubocop", *rubocop_args, "--", *cask_paths)
hide_warnings = debug? ? [] : [ENV["HOMEBREW_RUBY_PATH"], "-W0", "-S"]
system(cache_env, *hide_warnings, "rubocop", *rubocop_args, "--", *cask_paths)
raise CaskError, "style check failed" unless $CHILD_STATUS.success?
true
end

def install_rubocop
Expand Down Expand Up @@ -43,8 +43,8 @@ def default_args
[
"--require", "rubocop-cask",
"--force-default-config",
"--force-exclusion",
"--format", "simple"
"--format", "simple",
"--parallel"
]
end

Expand Down
7 changes: 5 additions & 2 deletions Library/Homebrew/test/cask/cli/style_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@

context "when rubocop succeeds" do
let(:success) { true }
it { is_expected.to be_truthy }

it "does not raise an error" do
expect { subject }.not_to raise_error
end
end

context "when rubocop fails" do
Expand Down Expand Up @@ -132,7 +135,7 @@
describe "#default_args" do
subject { cli.default_args }

it { is_expected.to include("--require", "rubocop-cask", "--format", "simple", "--force-exclusion") }
it { is_expected.to include("--require", "rubocop-cask", "--format", "simple") }
end

describe "#autocorrect_args" do
Expand Down

0 comments on commit 9f4b4a1

Please sign in to comment.