Zfilipin has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/252686

Change subject: Added test target to Rakefile
......................................................................

Added test target to Rakefile

This is needed for our continuous integration.

Also renamed rakefile to Rakefile, as all other repositories have.
Ignoring all RuboCop offenses in Rakefile.

Bug: T117993
Change-Id: Ia288f7e05339f466dc2a2558f5cf24dfef08f460
---
M .rubocop_todo.yml
M rakefile
2 files changed, 62 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/86/252686/1

diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index efc8d3a..66a599f 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,12 +1,12 @@
 # This configuration was generated by
 # `rubocop --auto-gen-config`
-# on 2015-09-03 11:44:34 +0200 using RuboCop version 0.33.0.
+# on 2015-11-12 14:36:42 +0100 using RuboCop version 0.33.0.
 # The point is for the user to remove these configuration records
 # one by one as the offenses are removed from the code base.
 # Note that changes in the inspected code, or installation of new
 # versions of RuboCop, may require this file to be generated again.
 
-# Offense count: 6
+# Offense count: 7
 # Configuration parameters: AllowSafeAssignment.
 Lint/AssignmentInCondition:
   Exclude:
@@ -26,17 +26,19 @@
   Exclude:
     - 'modules/puppetmaster/lib/puppet/reports/logstash.rb'
 
-# Offense count: 3
+# Offense count: 4
 # Cop supports --auto-correct.
 Lint/UnusedBlockArgument:
   Exclude:
+    - 'Rakefile'
     - 'modules/base/files/monitoring/check_puppetrun'
     - 
'modules/ganglia/lib/puppet/parser/functions/ganglia_aggregator_config.rb'
 
-# Offense count: 2
+# Offense count: 3
 # Cop supports --auto-correct.
 Lint/UnusedMethodArgument:
   Exclude:
+    - 'Rakefile'
     - 'modules/wmflib/lib/hiera/backend/role_backend.rb'
     - 'modules/wmflib/lib/hiera/mwcache.rb'
 
@@ -51,10 +53,16 @@
     - 'modules/wmflib/lib/hiera/backend/nuyaml_backend.rb'
     - 'modules/wmflib/lib/puppet/parser/functions/validate_array_re.rb'
 
-# Offense count: 182
+# Offense count: 185
 # Configuration parameters: AllowURI, URISchemes.
 Metrics/LineLength:
   Max: 158
+
+# Offense count: 4
+# Cop supports --auto-correct.
+Style/AlignArray:
+  Exclude:
+    - 'Rakefile'
 
 # Offense count: 1
 # Cop supports --auto-correct.
@@ -63,7 +71,7 @@
   Exclude:
     - 'modules/base/lib/puppet/parser/functions/pick_initscript.rb'
 
-# Offense count: 12
+# Offense count: 13
 # Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyle, SupportedStyles.
 Style/AndOr:
@@ -82,6 +90,12 @@
 Style/AsciiComments:
   Exclude:
     - 'modules/puppetmaster/lib/puppet/reports/logstash.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Style/BlockComments:
+  Exclude:
+    - 'Rakefile'
 
 # Offense count: 58
 # Cop supports --auto-correct.
@@ -181,10 +195,11 @@
     - 'modules/strongswan/Rakefile'
     - 'modules/wmflib/Rakefile'
 
-# Offense count: 8
+# Offense count: 9
 # Configuration parameters: AllowedVariables.
 Style/GlobalVars:
   Exclude:
+    - 'Rakefile'
     - 'utils/expanderb.rb'
     - 'utils/hiera_lookup'
 
@@ -194,7 +209,7 @@
   Exclude:
     - 'utils/hiera_lookup'
 
-# Offense count: 364
+# Offense count: 368
 # Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyle, SupportedStyles, 
UseHashRocketsWithSymbolValues.
 Style/HashSyntax:
@@ -206,7 +221,7 @@
 Style/IfUnlessModifier:
   Enabled: false
 
-# Offense count: 265
+# Offense count: 288
 # Cop supports --auto-correct.
 # Configuration parameters: Width.
 Style/IndentationWidth:
@@ -243,7 +258,7 @@
   Exclude:
     - 'modules/ganeti/lib/facter/ganeti.rb'
 
-# Offense count: 19
+# Offense count: 20
 # Cop supports --auto-correct.
 Style/NegatedIf:
   Enabled: false
@@ -253,10 +268,11 @@
   Exclude:
     - 'modules/graphite/lib/puppet/parser/functions/configparser_format.rb'
 
-# Offense count: 6
+# Offense count: 7
 # Cop supports --auto-correct.
 Style/Not:
   Exclude:
+    - 'Rakefile'
     - 'modules/base/files/monitoring/check_puppetrun'
     - 
'modules/ganglia/lib/puppet/parser/functions/ganglia_aggregator_config.rb'
     - 'modules/puppetmaster/files/puppetstoredconfigclean.rb'
@@ -304,11 +320,12 @@
   Exclude:
     - 'modules/wmflib/lib/puppet/parser/functions/ipresolve.rb'
 
-# Offense count: 15
+# Offense count: 16
 # Cop supports --auto-correct.
 # Configuration parameters: AllowMultipleReturnValues.
 Style/RedundantReturn:
   Exclude:
+    - 'Rakefile'
     - 
'modules/ganglia/lib/puppet/parser/functions/ganglia_aggregator_config.rb'
     - 'modules/graphite/lib/puppet/parser/functions/configparser_format.rb'
     - 'modules/wmflib/lib/hiera/backend/mwyaml_backend.rb'
@@ -325,7 +342,7 @@
     - 'modules/puppetmaster/lib/puppet/reports/logstash.rb'
     - 'modules/wmflib/lib/hiera/backend/proxy_backend.rb'
 
-# Offense count: 22
+# Offense count: 23
 # Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
 Style/RegexpLiteral:
@@ -341,14 +358,21 @@
     - 'modules/wmflib/lib/hiera/backend/role_backend.rb'
     - 'utils/hiera_lookup'
 
-# Offense count: 6
+# Offense count: 7
 Style/RescueModifier:
   Exclude:
     - 'modules/librenms/lib/puppet/parser/functions/phpdump.rb'
+    - 'modules/wmflib/lib/puppet/parser/functions/ini.rb'
     - 'modules/wmflib/lib/puppet/parser/functions/ordered_json.rb'
     - 'modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb'
     - 'modules/wmflib/lib/puppet/parser/functions/php_ini.rb'
     - 'modules/wmflib/lib/puppet/parser/functions/require_package.rb'
+
+# Offense count: 2
+# Cop supports --auto-correct.
+Style/SelfAssignment:
+  Exclude:
+    - 'Rakefile'
 
 # Offense count: 1
 # Cop supports --auto-correct.
@@ -357,7 +381,7 @@
   Exclude:
     - 'modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb'
 
-# Offense count: 22
+# Offense count: 23
 # Cop supports --auto-correct.
 Style/SpaceAfterComma:
   Exclude:
@@ -372,6 +396,7 @@
     - 'modules/wmflib/lib/hiera/backend/proxy_backend.rb'
     - 'modules/wmflib/lib/hiera/backend/role_backend.rb'
     - 'modules/wmflib/lib/hiera/mwcache.rb'
+    - 'modules/wmflib/lib/puppet/parser/functions/ini.rb'
     - 'modules/wmflib/spec/hiera/proxy_backend_spec.rb'
     - 'modules/wmflib/spec/hiera/role_backend_spec.rb'
 
@@ -381,17 +406,18 @@
 Style/SpaceAroundEqualsInParameterDefault:
   Enabled: false
 
-# Offense count: 12
+# Offense count: 13
 # Cop supports --auto-correct.
 # Configuration parameters: MultiSpaceAllowedForOperators.
 Style/SpaceAroundOperators:
   Exclude:
+    - 'Rakefile'
     - 'modules/labstore/lib/puppet/parser/functions/mount_nfs_volume.rb'
     - 'modules/librenms/lib/puppet/parser/functions/phpdump.rb'
     - 'modules/wmflib/lib/hiera/backend/proxy_backend.rb'
     - 'modules/wmflib/spec/hiera/role_backend_spec.rb'
 
-# Offense count: 38
+# Offense count: 39
 # Cop supports --auto-correct.
 Style/SpaceInsideBrackets:
   Enabled: false
@@ -402,10 +428,11 @@
 Style/SpaceInsideHashLiteralBraces:
   Enabled: false
 
-# Offense count: 7
+# Offense count: 19
 # Cop supports --auto-correct.
 Style/SpaceInsideParens:
   Exclude:
+    - 'Rakefile'
     - 'modules/graphite/lib/puppet/parser/functions/configparser_format.rb'
     - 'utils/expanderb.rb'
 
@@ -416,16 +443,17 @@
     - 'modules/puppetmaster/files/puppetstoredconfigclean.rb'
     - 'utils/expanderb.rb'
 
-# Offense count: 153
+# Offense count: 180
 # Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyle, SupportedStyles.
 Style/StringLiterals:
   Enabled: false
 
-# Offense count: 49
+# Offense count: 139
 # Cop supports --auto-correct.
 Style/Tab:
   Exclude:
+    - 'Rakefile'
     - 'modules/apt/lib/facter/apt.rb'
     - 'modules/git/spec/defines/user_spec.rb'
     - 'utils/expanderb.rb'
@@ -437,7 +465,7 @@
   Exclude:
     - 'modules/base/lib/facter/labsproject.rb'
 
-# Offense count: 116
+# Offense count: 117
 # Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
 Style/TrailingComma:
diff --git a/rakefile b/rakefile
index 0f776c4..466b1e0 100644
--- a/rakefile
+++ b/rakefile
@@ -204,3 +204,16 @@
 amass profit
 donate!
 =end
+
+require 'bundler/setup'
+
+require 'rubocop/rake_task'
+RuboCop::RakeTask.new(:rubocop) do |task|
+  # if you use mediawiki-vagrant, rubocop will by default use it's .rubocop.yml
+  # the next line makes it explicit that you want .rubocop.yml from the 
directory
+  # where `bundle exec rake` is executed
+  task.options = ['-c', '.rubocop.yml']
+end
+
+desc 'Run all build/tests commands (CI entry point)'
+task test: [:rubocop]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia288f7e05339f466dc2a2558f5cf24dfef08f460
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Zfilipin <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to