Single .rubocop.yml file for all Ruby files, attributes cleanup.

Also changed email & company name.

Addresses: blueprint rubocop-for-ops-messaging
Change-Id: I1bb991184f813bc574e1c6a4f5de3030b82c0b49
This commit is contained in:
Matt Ray 2014-01-15 13:20:26 -06:00
parent b6ee6c7f14
commit d90dd16ab5
10 changed files with 64 additions and 66 deletions

View File

@ -1,7 +1,16 @@
# UTF-8 headers not generally in these files AllCops:
Encoding: Includes:
Enabled: false - metadata.rb
- Gemfile
- attributes/**
Excludes:
- recipes/**
- spec/**
# ignore long lines # ignore long lines
LineLength: LineLength:
Enabled: false Enabled: false
# Allow small arrays before forcing %w or %W
WordArray:
MinSize: 3

View File

@ -9,37 +9,43 @@
"ref": "2201bd113ffe1742c19811aa4df59a5790af71e3" "ref": "2201bd113ffe1742c19811aa4df59a5790af71e3"
}, },
"rabbitmq": { "rabbitmq": {
"locked_version": "2.1.2" "locked_version": "2.3.2"
},
"erlang": {
"locked_version": "1.4.2"
}, },
"apt": { "apt": {
"locked_version": "2.0.0" "locked_version": "2.3.4"
}, },
"database": { "yum": {
"locked_version": "1.4.0"
},
"mysql": {
"locked_version": "3.0.0"
},
"openssl": {
"locked_version": "1.0.2"
},
"build-essential": {
"locked_version": "1.4.0"
},
"postgresql": {
"locked_version": "3.0.2" "locked_version": "3.0.2"
}, },
"yum-epel": {
"locked_version": "0.2.0"
},
"yum-erlang_solutions": {
"locked_version": "0.1.4"
},
"build-essential": {
"locked_version": "1.4.2"
},
"database": {
"locked_version": "1.6.0"
},
"mysql": {
"locked_version": "4.0.14"
},
"openssl": {
"locked_version": "1.1.0"
},
"postgresql": {
"locked_version": "3.3.4"
},
"aws": { "aws": {
"locked_version": "0.101.2" "locked_version": "1.0.0"
}, },
"xfs": { "xfs": {
"locked_version": "1.1.0" "locked_version": "1.1.0"
},
"erlang": {
"locked_version": "1.3.0"
},
"yum": {
"locked_version": "2.3.0"
} }
} }
} }

View File

@ -1,3 +1,4 @@
# encoding: UTF-8
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'chef', '~> 11.8' gem 'chef', '~> 11.8'

View File

@ -9,12 +9,12 @@ GEM
gyoku (>= 0.4.0) gyoku (>= 0.4.0)
nokogiri (>= 1.4.0) nokogiri (>= 1.4.0)
ast (1.1.0) ast (1.1.0)
berkshelf (2.0.10) berkshelf (2.0.12)
activesupport (~> 3.2.0) activesupport (~> 3.2.0)
addressable (~> 2.3.4) addressable (~> 2.3.4)
buff-shell_out (~> 0.1) buff-shell_out (~> 0.1)
chozo (>= 0.6.1) chozo (>= 0.6.1)
faraday (>= 0.8.5) faraday (~> 0.8.5)
hashie (>= 2.0.2) hashie (>= 2.0.2)
minitar (~> 0.5.4) minitar (~> 0.5.4)
rbzip2 (~> 0.2.0) rbzip2 (~> 0.2.0)
@ -74,7 +74,7 @@ GEM
coderay (1.1.0) coderay (1.1.0)
diff-lcs (1.2.5) diff-lcs (1.2.5)
erubis (2.7.0) erubis (2.7.0)
faraday (0.8.8) faraday (0.8.9)
multipart-post (~> 1.2.0) multipart-post (~> 1.2.0)
fauxhai (2.0.1) fauxhai (2.0.1)
net-ssh net-ssh
@ -91,10 +91,11 @@ GEM
multi_json (~> 1.3) multi_json (~> 1.3)
gssapi (1.0.3) gssapi (1.0.3)
ffi (>= 1.0.1) ffi (>= 1.0.1)
gyoku (1.1.0) gyoku (1.1.1)
builder (>= 2.1.2) builder (>= 2.1.2)
hashie (2.0.5) hashie (2.0.5)
highline (1.6.20) highline (1.6.20)
hitimes (1.2.1)
httpclient (2.3.4.1) httpclient (2.3.4.1)
httpi (0.9.7) httpi (0.9.7)
rack rack
@ -115,7 +116,7 @@ GEM
mixlib-log (1.6.0) mixlib-log (1.6.0)
mixlib-shellout (1.3.0) mixlib-shellout (1.3.0)
moneta (0.6.0) moneta (0.6.0)
multi_json (1.8.2) multi_json (1.8.4)
multipart-post (1.2.0) multipart-post (1.2.0)
net-http-persistent (2.9) net-http-persistent (2.9)
net-ssh (2.7.0) net-ssh (2.7.0)
@ -124,8 +125,8 @@ GEM
net-ssh-multi (1.1) net-ssh-multi (1.1)
net-ssh (>= 2.1.4) net-ssh (>= 2.1.4)
net-ssh-gateway (>= 0.99.0) net-ssh-gateway (>= 0.99.0)
nio4r (0.5.0) nio4r (1.0.0)
nokogiri (1.5.10) nokogiri (1.5.11)
nori (1.1.5) nori (1.1.5)
ohai (6.20.0) ohai (6.20.0)
ipaddress ipaddress
@ -135,7 +136,7 @@ GEM
mixlib-shellout mixlib-shellout
systemu (~> 2.5.2) systemu (~> 2.5.2)
yajl-ruby yajl-ruby
parser (2.1.2) parser (2.1.4)
ast (~> 1.1) ast (~> 1.1)
slop (~> 3.4, >= 3.4.5) slop (~> 3.4, >= 3.4.5)
polyglot (0.3.3) polyglot (0.3.3)
@ -148,11 +149,11 @@ GEM
rack (~> 1.2) rack (~> 1.2)
rack (1.5.2) rack (1.5.2)
rainbow (1.99.1) rainbow (1.99.1)
rake (10.1.0) rake (10.1.1)
rbzip2 (0.2.0) rbzip2 (0.2.0)
rest-client (1.6.7) rest-client (1.6.7)
mime-types (>= 1.16) mime-types (>= 1.16)
retryable (1.3.3) retryable (1.3.4)
ridley (1.5.3) ridley (1.5.3)
addressable addressable
buff-config (~> 0.2) buff-config (~> 0.2)
@ -201,12 +202,13 @@ GEM
buff-platform (~> 0.1) buff-platform (~> 0.1)
systemu (2.5.2) systemu (2.5.2)
thor (0.18.1) thor (0.18.1)
timers (1.1.0) timers (2.0.0)
hitimes
treetop (1.4.15) treetop (1.4.15)
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
uuidtools (2.1.4) uuidtools (2.1.4)
varia_model (0.2.0) varia_model (0.3.2)
buff-extensions (~> 0.2) buff-extensions (~> 0.2)
hashie (>= 2.0.2) hashie (>= 2.0.2)
wasabi (1.0.0) wasabi (1.0.0)

View File

@ -1,8 +1,5 @@
# Strainerfile # Strainerfile
rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK/Gemfile $SANDBOX/$COOKBOOK/metadata.rb --config $SANDBOX/$COOKBOOK/.rubocop.yml rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK/ --config $SANDBOX/$COOKBOOK/.rubocop.yml
rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK/spec/ --config $SANDBOX/$COOKBOOK/spec/.rubocop.yml
# rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK
rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK/recipes/ --config $SANDBOX/$COOKBOOK/recipes/.rubocop.yml
knife test: bundle exec knife cookbook test $COOKBOOK knife test: bundle exec knife cookbook test $COOKBOOK
foodcritic: bundle exec foodcritic -f any -t ~FC003 -t ~FC023 $SANDBOX/$COOKBOOK foodcritic: bundle exec foodcritic -f any -t ~FC003 $SANDBOX/$COOKBOOK
chefspec: bundle exec rspec $SANDBOX/$COOKBOOK/spec chefspec: bundle exec rspec $SANDBOX/$COOKBOOK/spec

View File

@ -18,15 +18,6 @@ Or you may run the tests individually:
[Rubocop](https://github.com/bbatsov/rubocop) is a static Ruby code analyzer, based on the community [Ruby style guide](https://github.com/bbatsov/ruby-style-guide). We are attempting to adhere to this where applicable, slowly cleaning up the cookbooks until we can turn on Rubocop for gating the commits. [Rubocop](https://github.com/bbatsov/rubocop) is a static Ruby code analyzer, based on the community [Ruby style guide](https://github.com/bbatsov/ruby-style-guide). We are attempting to adhere to this where applicable, slowly cleaning up the cookbooks until we can turn on Rubocop for gating the commits.
### Attribute Rules ###
Since there are slight style differences between the coding of attributes, recipes and metadata files there are specific `.rubocop.yml` files for each of:
[Gemfile and metadata.rb](.rubocop.yml)
[attributes/*.rb](attributes/.rubocop.yml)
[recipes/.rubocop.yml](recipes/.rubocop.yml)
[spec/.rubocop.yml](spec/.rubocop.yml)
## Knife ## ## Knife ##
[knife cookbook test](http://docs.opscode.com/chef/knife.html#test) is used to check the cookbook's Ruby and ERB files for basic syntax errors. [knife cookbook test](http://docs.opscode.com/chef/knife.html#test) is used to check the cookbook's Ruby and ERB files for basic syntax errors.

View File

@ -1,3 +1,4 @@
# encoding: UTF-8
# #
# Cookbook Name:: openstack-ops-messaging # Cookbook Name:: openstack-ops-messaging
# Recipe:: default # Recipe:: default
@ -18,10 +19,10 @@
# limitations under the License. # limitations under the License.
# #
default["openstack"]["mq"]["bind_interface"] = "lo" default['openstack']['mq']['bind_interface'] = 'lo'
default["openstack"]["mq"]["cluster"] = false default['openstack']['mq']['cluster'] = false
['block-storage', 'compute', 'image', 'metering', 'network'].each do |service| %w[block-storage compute image metering network].each do |service|
default['openstack'][service]['rabbit']['host'] = node['openstack']['mq']['listen'] default['openstack'][service]['rabbit']['host'] = node['openstack']['mq']['listen']
default['openstack'][service]['rabbit']['port'] = node['openstack']['mq']['port'] default['openstack'][service]['rabbit']['port'] = node['openstack']['mq']['port']
default['openstack'][service]['rabbit']['username'] = node['openstack']['mq']['user'] default['openstack'][service]['rabbit']['username'] = node['openstack']['mq']['user']

View File

@ -1,6 +1,7 @@
# encoding: UTF-8
name 'openstack-ops-messaging' name 'openstack-ops-messaging'
maintainer 'Opscode, Inc.' maintainer 'Chef Software, Inc.'
maintainer_email 'matt@opscode.com' maintainer_email 'matt@getchef.com'
license 'Apache 2.0' license 'Apache 2.0'
description 'Provides the shared messaging configuration for Chef for OpenStack.' description 'Provides the shared messaging configuration for Chef for OpenStack.'
version '8.0.1' version '8.0.1'

View File

@ -1,3 +0,0 @@
# embedded attributes make for long lines
LineLength:
Enabled: false

View File

@ -1,7 +0,0 @@
# embedded attributes make for long lines
LineLength:
Enabled: false
# Allow small arrays before forcing %w or %W
WordArray:
MinSize: 3