1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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:
Utkarsh Gupta 2020-06-16 19:07:21 +05:30 committed by Hiroshi SHIBATA
parent f9de8ccf1e
commit d9c888d394
Notes: git 2020-06-18 19:15:01 +09:00
2 changed files with 9 additions and 0 deletions
lib/bundler/cli
spec/bundler/commands

View file

@ -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]

View file

@ -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