aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJosh Hagins2016-10-18 19:22:12 -0400
committerGitHub2016-10-18 19:22:12 -0400
commitd08f61a704fa174c0990e602a89b9b5bcbc8228a (patch)
treefe2a7e9d08ba9a2af843f333f52020e2014af5c6 /Library
parent63122c241ce5c46e8201fe55773632e11e7eb187 (diff)
parent143c3ac5c83c2d3b5c597352f3a1a59bd721f962 (diff)
downloadbrew-d08f61a704fa174c0990e602a89b9b5bcbc8228a.tar.bz2
Merge pull request #1317 from reitermarkus/refactor-rubocop-cask
Refactor `brew cask style` not to require `.rubocop.yml`.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/style.rb11
-rw-r--r--Library/Homebrew/cask/spec/cask/cli/style_spec.rb6
2 files changed, 7 insertions, 10 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/style.rb b/Library/Homebrew/cask/lib/hbc/cli/style.rb
index c6a08671f..0dd4bc474 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/style.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/style.rb
@@ -54,17 +54,18 @@ module Hbc
end
def default_args
- ["--format", "simple", "--force-exclusion", "--config", rubocop_config]
+ [
+ "--require", "rubocop-cask",
+ "--config", "/dev/null", # always use `rubocop-cask` default config
+ "--format", "simple",
+ "--force-exclusion"
+ ]
end
def autocorrect_args
default_args + ["--auto-correct"]
end
- def rubocop_config
- Hbc.default_tap.cask_dir.join(".rubocop.yml")
- end
-
def fix?
args.any? { |arg| arg =~ %r{--(fix|(auto-?)?correct)} }
end
diff --git a/Library/Homebrew/cask/spec/cask/cli/style_spec.rb b/Library/Homebrew/cask/spec/cask/cli/style_spec.rb
index 74ff10814..dbd6970d5 100644
--- a/Library/Homebrew/cask/spec/cask/cli/style_spec.rb
+++ b/Library/Homebrew/cask/spec/cask/cli/style_spec.rb
@@ -175,12 +175,8 @@ describe Hbc::CLI::Style do
describe "#default_args" do
subject { cli.default_args }
- let(:rubocop_config) { ".rubocop.yml" }
- before do
- allow(cli).to receive(:rubocop_config).and_return(rubocop_config)
- end
- it { is_expected.to include("--format", "simple", "--force-exclusion", "--config", rubocop_config) }
+ it { is_expected.to include("--require", "rubocop-cask", "--format", "simple", "--force-exclusion") }
end
describe "#autocorrect_args" do