From 0ef57f04739c24ace2b0f3cd2a61276577ba92bd Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Tue, 24 Dec 2013 09:40:34 -0600 Subject: [PATCH] Rubocop support for metadata.rb and Gemfile Replace double-quotes with single-quotes for now, expect this to act as a gate in the future. Change-Id: I10ff8b23517cb334905b162ce14059dbf23d7bc8 --- .rubocop.yml | 7 +++++++ Gemfile | 16 ++++++++-------- Strainerfile | 2 ++ metadata.rb | 34 +++++++++++++++++----------------- 4 files changed, 34 insertions(+), 25 deletions(-) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..7a296ac --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,7 @@ +# UTF-8 headers not generally in these files +Encoding: + Enabled: false + +# ignore long lines +LineLength: + Enabled: false diff --git a/Gemfile b/Gemfile index 840af0a..fa26df3 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,9 @@ -source "https://rubygems.org" +source 'https://rubygems.org' -gem "chef", "~> 11.4.4" -gem "json", "<= 1.7.7" # chef 11 dependency -gem "berkshelf", "~> 2.0.10" -gem "chefspec", "~> 3.0.2" -gem "foodcritic", "~> 3.0.3" -gem "strainer" -gem "rubocop" +gem 'chef', '~> 11.4.4' +gem 'json', '<= 1.7.7' # chef 11 dependency +gem 'berkshelf', '~> 2.0.10' +gem 'chefspec', '~> 3.0.2' +gem 'foodcritic', '~> 3.0.3' +gem 'strainer' +gem 'rubocop' diff --git a/Strainerfile b/Strainerfile index cede8bf..77a72ec 100644 --- a/Strainerfile +++ b/Strainerfile @@ -1,5 +1,7 @@ # Strainerfile rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK/attributes/ +rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK/metadata.rb +rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK/Gemfile # rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK # may want to add rubocop check for Berksfile and Gemfile knife test: bundle exec knife cookbook test $COOKBOOK diff --git a/metadata.rb b/metadata.rb index ddfaa46..68470b8 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,24 +1,24 @@ -name "openstack-block-storage" -maintainer "AT&T Services, Inc." -maintainer_email "cookbooks@lists.tfoundry.com" -license "Apache 2.0" -description "The OpenStack Advanced Volume Management service Cinder." +name 'openstack-block-storage' +maintainer 'AT&T Services, Inc.' +maintainer_email 'cookbooks@lists.tfoundry.com' +license 'Apache 2.0' +description 'The OpenStack Advanced Volume Management service Cinder.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "8.0.0" +version '8.0.0' -recipe "openstack-block-storage::common", "Defines the common pieces of repeated code from the other recipes" -recipe "openstack-block-storage::api", "Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone" -recipe "openstack-block-storage::keystone_registration", "Registers cinder service/user/endpoints in keystone" -recipe "openstack-block-storage::scheduler", "Installs the cinder-scheduler service" -recipe "openstack-block-storage::volume", "Installs the cinder-volume service and sets up the iscsi helper" +recipe 'openstack-block-storage::common', 'Defines the common pieces of repeated code from the other recipes' +recipe 'openstack-block-storage::api', 'Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone' +recipe 'openstack-block-storage::keystone_registration', 'Registers cinder service/user/endpoints in keystone' +recipe 'openstack-block-storage::scheduler', 'Installs the cinder-scheduler service' +recipe 'openstack-block-storage::volume', 'Installs the cinder-volume service and sets up the iscsi helper' %w{ ubuntu fedora redhat centos suse }.each do |os| supports os end -depends "apt" -depends "openstack-common", "~> 8.0" -depends "openstack-identity", "~> 8.0" -depends "openstack-image", "~> 8.0" -depends "selinux" -depends "python" +depends 'apt' +depends 'openstack-common', '~> 8.0' +depends 'openstack-identity', '~> 8.0' +depends 'openstack-image', '~> 8.0' +depends 'selinux' +depends 'python'