Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/339175 )

Change subject: rubocop disable Style/PercentLiteralDelimiters
......................................................................


rubocop disable Style/PercentLiteralDelimiters

The rubocop rule is quite annoying, it enforces specific delimiters in
ruby string literals. The one to delimite regex enforces curly braces
such as:

  %{my regex here}

Though curly braces are used in regex, and we have lot of examples using
an exclamation marks or percentage signs instead:

  %r!^lib/puppet\.rb$!
  %r%^lib/(.*)\.rb$%

Disable Style/PercentLiteralDelimiters so we can use whatever delimiters
we want.

Manually update .rubocop_todo.yml to drop the per file ignores now that
it is globally disabled.  We can not auto generate it via
--auto-gen-config since we already manually edited it at various places.

Style reference:
    https://github.com/bbatsov/ruby-style-guide#percent-literal-braces

Change-Id: I7a1c52a1616f5efe3be77d37fa70b9a6752bc173
---
M .rubocop.yml
M .rubocop_todo.yml
2 files changed, 4 insertions(+), 11 deletions(-)

Approvals:
  Dduvall: Looks good to me, but someone else must approve
  Hashar: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/.rubocop.yml b/.rubocop.yml
index e900132..d1b0821 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -25,6 +25,10 @@
 Style/Alias:
   Enabled: false
 
+# Let us whatever delimiters we want eg: %{One Two} or %r%/tmp%
+Style/PercentLiteralDelimiters:
+  Enabled: false
+
 Style/SignalException:
   Enabled: false
 
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index d96ce2c..96445cb 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -228,17 +228,6 @@
   Exclude:
     - 'modules/wmflib/lib/puppet/parser/functions/ipresolve.rb'
 
-# Offense count: 10
-# Cop supports --auto-correct.
-# Configuration parameters: PreferredDelimiters.
-Style/PercentLiteralDelimiters:
-  Exclude:
-    - 'modules/apt/lib/facter/apt.rb'
-    - 'modules/base/lib/facter/initsystem.rb'
-    - 'modules/base/lib/facter/lldp.rb'
-    - 'modules/ganeti/lib/facter/ganeti.rb'
-    - 'modules/gridengine/lib/puppet/provider/gridengine_resource/parsed.rb'
-
 # Offense count: 2
 # Cop supports --auto-correct.
 Style/PerlBackrefs:

-- 
To view, visit https://gerrit.wikimedia.org/r/339175
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a1c52a1616f5efe3be77d37fa70b9a6752bc173
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Dduvall <dduv...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Zfilipin <zfili...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to