summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-04 12:27:21 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-04 19:25:37 +0100
commitd53a14d9967891f2009ada602e7790ab23997ff0 (patch)
treeef15fcf14c28b981952fc5f221cbe55c5157f94c
parent5c456b21162daa4cd7d4bef1b001a6899acaaeae (diff)
downloadbundler-fix_offenses_for_more_cops.tar.gz
Disable `Style/GuardClause` copfix_offenses_for_more_cops
Sometimes rubocop misunderstand semantics, and forces you to write code that feels worse. I prefer to disable it.
-rw-r--r--.rubocop.yml3
-rw-r--r--.rubocop_todo.yml15
-rw-r--r--lib/bundler/plugin/installer.rb5
3 files changed, 3 insertions, 20 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 7f8997dc1f..4226671d3a 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -50,6 +50,9 @@ Style/Alias:
Style/FrozenStringLiteralComment:
EnforcedStyle: always
+Style/GuardClause:
+ Enabled: false
+
Style/MultilineBlockChain:
Enabled: false
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index c17f201e5b..e44c926033 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -386,21 +386,6 @@ Style/GlobalVars:
- 'lib/bundler/cli.rb'
- 'spec/spec_helper.rb'
-# Offense count: 11
-# Configuration parameters: MinBodyLength.
-Style/GuardClause:
- Exclude:
- - 'lib/bundler/cli/cache.rb'
- - 'lib/bundler/cli/install.rb'
- - 'lib/bundler/cli/outdated.rb'
- - 'lib/bundler/cli/package.rb'
- - 'lib/bundler/definition.rb'
- - 'lib/bundler/installer.rb'
- - 'lib/bundler/runtime.rb'
- - 'lib/bundler/source/path/installer.rb'
- - 'lib/bundler/source_list.rb'
- - 'spec/support/sometimes.rb'
-
# Offense count: 108
# Cop supports --auto-correct.
Style/IfUnlessModifier:
diff --git a/lib/bundler/plugin/installer.rb b/lib/bundler/plugin/installer.rb
index 713d679f12..a2ec0c1d65 100644
--- a/lib/bundler/plugin/installer.rb
+++ b/lib/bundler/plugin/installer.rb
@@ -43,16 +43,11 @@ module Bundler
private
- # Rubocop misunderstands the semantics of this method, assuming an `else` code block
- # that doesn't exist. See https://github.com/bbatsov/rubocop/issues/5702.
- #
- # rubocop:disable Style/GuardClause
def check_sources_consistency!(options)
if options.key?(:git) && options.key?(:local_git)
raise InvalidOption, "Remote and local plugin git sources can't be both specified"
end
end
- # rubocop:enable Style/GuardClause
def install_git(names, version, options)
uri = options.delete(:git)