From ec98d5615360c33fa2419b22cf2ac7d1834d9c18 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Tue, 16 Jun 2020 18:06:48 +0530 Subject: Ship default .rubocop.yml Currently, there is no `.rubocop.yml` shipped by default. So when a user runs `rubocop` after creating a new gem via `bundle gem foo`, it throws a bunch of offenses. With the default `.rubocop.yml` present, the number of those offenses significantly reduce by 25. Signed-off-by: Utkarsh Gupta --- lib/bundler/cli/gem.rb | 1 + lib/bundler/templates/newgem/rubocop.yml.tt | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 lib/bundler/templates/newgem/rubocop.yml.tt (limited to 'lib') diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index 5b4e436d99..df93fd92a6 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -79,6 +79,7 @@ module Bundler ] templates.merge!("gitignore.tt" => ".gitignore") if Bundler.git_present? + templates.merge!("rubocop.yml.tt" => ".rubocop.yml") if test_framework = ask_and_set_test_framework config[:test] = test_framework diff --git a/lib/bundler/templates/newgem/rubocop.yml.tt b/lib/bundler/templates/newgem/rubocop.yml.tt new file mode 100644 index 0000000000..ca11bac1b6 --- /dev/null +++ b/lib/bundler/templates/newgem/rubocop.yml.tt @@ -0,0 +1,7 @@ +Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes + +Style/StringLiteralsInInterpolation: + Enabled: true + EnforcedStyle: double_quotes -- cgit v1.2.3