]> git.openstreetmap.org Git - chef.git/commitdiff
Fix new rubocop warnings
authorTom Hughes <tom@compton.nu>
Tue, 18 Aug 2015 21:59:13 +0000 (22:59 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 18 Aug 2015 21:59:40 +0000 (22:59 +0100)
.rubocop.yml
.rubocop_todo.yml
cookbooks/apt/metadata.rb
cookbooks/apt/providers/source.rb
cookbooks/devices/metadata.rb
cookbooks/mediawiki/resources/site.rb
cookbooks/sysctl/metadata.rb
cookbooks/sysctl/recipes/default.rb
cookbooks/sysfs/metadata.rb
cookbooks/web/recipes/gpx.rb
roles/web-backend.rb

index b6fd6fcc311875c55c8412b766d431fa719dd74a..2219d6ec67ec53c4270a3eac6b94b8996b644936 100644 (file)
@@ -4,6 +4,9 @@ Style/AlignParameters:
   Exclude:
     - '**/metadata.rb'
 
   Exclude:
     - '**/metadata.rb'
 
+Style/ExtraSpacing:
+  AllowForAlignment: true
+
 Style/FileName:
   Exclude:
     - 'cookbooks/trac/files/default/trac-authenticate'
 Style/FileName:
   Exclude:
     - 'cookbooks/trac/files/default/trac-authenticate'
index d63b1da17ba72aeccf82ad734dbbd2d26717bdad..4a5009387c4292b8aaee0f5dc4813a8c99816906 100644 (file)
@@ -1,31 +1,33 @@
-# This configuration was generated by `rubocop --auto-gen-config`
-# on 2015-02-03 10:18:23 +0000 using RuboCop version 0.28.0.
+# This configuration was generated by
+# `rubocop --auto-gen-config`
+# on 2015-08-18 22:54:59 +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.
 
 # 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: 2
+# Offense count: 1
 Lint/HandleExceptions:
 Lint/HandleExceptions:
-  Enabled: false
+  Exclude:
+    - 'cookbooks/networking/definitions/firewall_rule.rb'
 
 # Offense count: 22
 Metrics/AbcSize:
 
 # Offense count: 22
 Metrics/AbcSize:
-  Max: 83
+  Max: 66
 
 
-# Offense count: 4
+# Offense count: 3
 Metrics/CyclomaticComplexity:
   Max: 8
 
 Metrics/CyclomaticComplexity:
   Max: 8
 
-# Offense count: 298
+# Offense count: 338
 # Configuration parameters: AllowURI, URISchemes.
 Metrics/LineLength:
   Max: 451
 
 # Configuration parameters: AllowURI, URISchemes.
 Metrics/LineLength:
   Max: 451
 
-# Offense count: 21
+# Offense count: 23
 # Configuration parameters: CountComments.
 Metrics/MethodLength:
 # Configuration parameters: CountComments.
 Metrics/MethodLength:
-  Max: 37
+  Max: 28
 
 # Offense count: 1
 Metrics/PerceivedComplexity:
 
 # Offense count: 1
 Metrics/PerceivedComplexity:
@@ -33,14 +35,41 @@ Metrics/PerceivedComplexity:
 
 # Offense count: 14
 Style/Documentation:
 
 # Offense count: 14
 Style/Documentation:
-  Enabled: false
+  Exclude:
+    - 'cookbooks/chef/libraries/compare_versions.rb'
+    - 'cookbooks/chef/libraries/edit_file.rb'
+    - 'cookbooks/chef/libraries/random_password.rb'
+    - 'cookbooks/chef/libraries/remote_directory.rb'
+    - 'cookbooks/chef/libraries/subversion.rb'
+    - 'cookbooks/hardware/libraries/sensors.rb'
+    - 'cookbooks/munin/libraries/expand.rb'
+    - 'cookbooks/mysql/libraries/mysql.rb'
+    - 'cookbooks/networking/libraries/interfaces.rb'
+    - 'cookbooks/networking/libraries/ipaddresses.rb'
+    - 'cookbooks/postgresql/libraries/postgresql.rb'
+    - 'cookbooks/tile/files/default/ruby/expire.rb'
+    - 'cookbooks/wordpress/libraries/wordpress.rb'
 
 
-# Offense count: 15
+# Offense count: 19
+# Cop supports --auto-correct.
 # Configuration parameters: MaxLineLength.
 Style/IfUnlessModifier:
 # Configuration parameters: MaxLineLength.
 Style/IfUnlessModifier:
-  Enabled: false
+  Exclude:
+    - 'cookbooks/accounts/recipes/default.rb'
+    - 'cookbooks/apache/providers/conf.rb'
+    - 'cookbooks/apache/providers/module.rb'
+    - 'cookbooks/chef/libraries/compare_versions.rb'
+    - 'cookbooks/exim/recipes/default.rb'
+    - 'cookbooks/hardware/attributes/default.rb'
+    - 'cookbooks/hardware/recipes/default.rb'
+    - 'cookbooks/munin/recipes/default.rb'
+    - 'cookbooks/nodejs/recipes/default.rb'
+    - 'cookbooks/tile/files/default/ruby/expire.rb'
+    - 'cookbooks/tile/recipes/default.rb'
+    - 'cookbooks/tools/recipes/default.rb'
+    - 'cookbooks/web/recipes/cgimap.rb'
 
 
-# Offense count: 29
+# Offense count: 28
 # Cop supports --auto-correct.
 Style/NumericLiterals:
   MinDigits: 11
 # Cop supports --auto-correct.
 Style/NumericLiterals:
   MinDigits: 11
index ee74103b92ad35d4b11fda24926de6b921441511..d9661aae252178bf9a21577510fd077acf31b435 100644 (file)
@@ -1,4 +1,4 @@
-name              "apt"
+name             "apt"
 maintainer       "Tom Hughes"
 maintainer_email "tom@compton.nu"
 license          "Apache 2.0"
 maintainer       "Tom Hughes"
 maintainer_email "tom@compton.nu"
 license          "Apache 2.0"
index cce755a637b79219d15d4504bf0a8325173e5097..b6a31863444001681743ea6db78471a9fcb234a2 100644 (file)
@@ -31,7 +31,7 @@ action :create do
     end
   end
 
     end
   end
 
-  template source_path  do
+  template source_path do
     source new_resource.template
     owner "root"
     group "root"
     source new_resource.template
     owner "root"
     group "root"
index 8c75714846f43cda1da9b6742dc4a395a806a359..87e069b20ba1a80808e34204249312345d981a1a 100644 (file)
@@ -1,4 +1,4 @@
-name              "devices"
+name             "devices"
 maintainer       "Tom Hughes"
 maintainer_email "tom@compton.nu"
 license          "Apache 2.0"
 maintainer       "Tom Hughes"
 maintainer_email "tom@compton.nu"
 license          "Apache 2.0"
index a210e806b6ac8498b6486f27b4a8b83a4b222b2f..e7838ed0feb952c410c012da75fdc669f1e6d750 100644 (file)
@@ -34,7 +34,7 @@ attribute :email_contact, :kind_of => String, :default => ""
 attribute :email_sender, :kind_of => String, :default => ""
 attribute :email_sender_name, :kind_of => String, :default => "MediaWiki Mail"
 attribute :commons, :kind_of => [TrueClass, FalseClass], :default => true
 attribute :email_sender, :kind_of => String, :default => ""
 attribute :email_sender_name, :kind_of => String, :default => "MediaWiki Mail"
 attribute :commons, :kind_of => [TrueClass, FalseClass], :default => true
-attribute :skin, :kind_of => String, :default =>  "vector"
+attribute :skin, :kind_of => String, :default => "vector"
 attribute :site_notice, :kind_of => String, :default => ""
 attribute :site_readonly, :kind_of => [TrueClass, FalseClass], :default => false
 attribute :admin_user, :kind_of => String, :default => "Admin"
 attribute :site_notice, :kind_of => String, :default => ""
 attribute :site_readonly, :kind_of => [TrueClass, FalseClass], :default => false
 attribute :admin_user, :kind_of => String, :default => "Admin"
@@ -75,7 +75,7 @@ def mediawiki_params
     :site_notice => site_notice,
     :site_readonly => site_readonly,
     :ssl_enabled => ssl_enabled,
     :site_notice => site_notice,
     :site_readonly => site_readonly,
     :ssl_enabled => ssl_enabled,
-    :extra_file_extensions  => extra_file_extensions,
+    :extra_file_extensions => extra_file_extensions,
     :private_accounts => private_accounts,
     :private => private
   }
     :private_accounts => private_accounts,
     :private => private
   }
index 8d12ccdc92f5bbabce402675210c9c92230cd24f..45a9fd5740ad41edd9ce75c6ae54a1eb9966835c 100644 (file)
@@ -1,14 +1,10 @@
-name              "sysctl"
+name             "sysctl"
 maintainer       "Tom Hughes"
 maintainer_email "tom@compton.nu"
 license          "Apache 2.0"
 description      "Configures kernel parameters"
 long_description IO.read(File.join(File.dirname(__FILE__), "README.md"))
 version          "0.1"
 maintainer       "Tom Hughes"
 maintainer_email "tom@compton.nu"
 license          "Apache 2.0"
 description      "Configures kernel parameters"
 long_description IO.read(File.join(File.dirname(__FILE__), "README.md"))
 version          "0.1"
-%w(redhat centos debian ubuntu).each do |os|
-  supports os
-end
-recipe           "sysctl", "Configure kernel parameters"
 
 attribute "sysctl",
   :display_name => "Kernel Parameters",
 
 attribute "sysctl",
   :display_name => "Kernel Parameters",
index 7a0ed43573fbb6c6b369349d5c86dfaec506f649..562504835fceaa7c11154c01fe2170ce0ce15d3f 100644 (file)
@@ -42,7 +42,7 @@ end
 
 node[:sysctl].each_value do |group|
   group[:parameters].each do |key, value|
 
 node[:sysctl].each_value do |group|
   group[:parameters].each do |key, value|
-    sysctl_file = "/proc/sys/#{key.gsub('.', '/')}"
+    sysctl_file = "/proc/sys/#{key.tr('.', '/')}"
 
     file sysctl_file do
       content "#{value}\n"
 
     file sysctl_file do
       content "#{value}\n"
index d1853f120f40bb14425ef5f842ec7e3b015a6591..925150b511aa6b272799554588782c3dffc7a8d7 100644 (file)
@@ -1,4 +1,4 @@
-name              "sysfs"
+name             "sysfs"
 maintainer       "Tom Hughes"
 maintainer_email "tom@compton.nu"
 license          "Apache 2.0"
 maintainer       "Tom Hughes"
 maintainer_email "tom@compton.nu"
 license          "Apache 2.0"
index 3802cfd7fd5da6ddd0436c3cc881ad437e01605d..51eea1ed47863c09235e9e23a70d2947837682cc 100644 (file)
@@ -61,7 +61,7 @@ template "/etc/init.d/gpx-import" do
   variables :gpx_directory => gpx_directory,
             :pid_directory => pid_directory,
             :log_directory => log_directory,
   variables :gpx_directory => gpx_directory,
             :pid_directory => pid_directory,
             :log_directory => log_directory,
-            :database_host =>  node[:web][:database_host],
+            :database_host => node[:web][:database_host],
             :database_name => "openstreetmap",
             :database_username => "gpximport",
             :database_password => db_passwords["gpximport"]
             :database_name => "openstreetmap",
             :database_username => "gpximport",
             :database_password => db_passwords["gpximport"]
index 51d7c477ef14239081f5a54b7490ed6f63cdc4b9..3474840e80904d591aaf11a4a50f043b8fa56cc5 100644 (file)
@@ -16,7 +16,7 @@ default_attributes(
       ]
     }
   },
       ]
     }
   },
-  :memcached  => {
+  :memcached => {
     :memory_limit => 4096
   },
   :passenger => {
     :memory_limit => 4096
   },
   :passenger => {