summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorUtkarsh Gupta <utkarsh@debian.org>2020-06-16 18:06:48 +0530
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-18 19:14:15 +0900
commitec98d5615360c33fa2419b22cf2ac7d1834d9c18 (patch)
tree4c05b1510db82d045b315d55d5432e7e3420fd7d /lib
parentd9c888d394575cd612c3af7f7bb82d0d01511428 (diff)
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 <utkarsh@debian.org>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3212
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli/gem.rb1
-rw-r--r--lib/bundler/templates/newgem/rubocop.yml.tt7
2 files changed, 8 insertions, 0 deletions
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