зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Only add .rubocop.yml when --rubocop flag is passed
Signed-off-by: Utkarsh Gupta <utkarsh@debian.org> https://github.com/rubygems/rubygems/commit/ef2dae4222
This commit is contained in:
Родитель
f9de8ccf1e
Коммит
d9c888d394
|
@ -148,6 +148,7 @@ module Bundler
|
|||
"and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
|
||||
config[:rubocop] = true
|
||||
Bundler.ui.info "RuboCop enabled in config"
|
||||
templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
|
||||
end
|
||||
|
||||
templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
|
||||
|
|
|
@ -169,6 +169,10 @@ RSpec.describe "bundle gem" do
|
|||
rubocop_dep = builder.dependencies.find {|d| d.name == "rubocop" }
|
||||
expect(rubocop_dep).not_to be_nil
|
||||
end
|
||||
|
||||
it "generates a default .rubocop.yml" do
|
||||
expect(bundled_app("#{gem_name}/.rubocop.yml")).to exist
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for "--no-rubocop flag" do
|
||||
|
@ -192,6 +196,10 @@ RSpec.describe "bundle gem" do
|
|||
rubocop_dep = builder.dependencies.find {|d| d.name == "rubocop" }
|
||||
expect(rubocop_dep).to be_nil
|
||||
end
|
||||
|
||||
it "doesn't generate a default .rubocop.yml" do
|
||||
expect(bundled_app("#{gem_name}/.rubocop.yml")).to_not exist
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for "CI config is absent" do
|
||||
|
|
Загрузка…
Ссылка в новой задаче