Skip to content
Snippets Groups Projects
Commit 3a22aff1 authored by Markus Reiter's avatar Markus Reiter
Browse files

Refactor `brew cask style` not to require `.rubocop.yml`.

parent 2da012d8
No related branches found
No related tags found
No related merge requests found
......@@ -54,17 +54,17 @@ module Hbc
end
def default_args
["--format", "simple", "--force-exclusion", "--config", rubocop_config]
[
"--require", "rubocop-cask",
"--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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment