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:
parent
b6ee6c7f14
commit
d90dd16ab5
15
.rubocop.yml
15
.rubocop.yml
|
@ -1,7 +1,16 @@
|
|||
# UTF-8 headers not generally in these files
|
||||
Encoding:
|
||||
Enabled: false
|
||||
AllCops:
|
||||
Includes:
|
||||
- metadata.rb
|
||||
- Gemfile
|
||||
- attributes/**
|
||||
Excludes:
|
||||
- recipes/**
|
||||
- spec/**
|
||||
|
||||
# ignore long lines
|
||||
LineLength:
|
||||
Enabled: false
|
||||
|
||||
# Allow small arrays before forcing %w or %W
|
||||
WordArray:
|
||||
MinSize: 3
|
||||
|
|
|
@ -9,37 +9,43 @@
|
|||
"ref": "2201bd113ffe1742c19811aa4df59a5790af71e3"
|
||||
},
|
||||
"rabbitmq": {
|
||||
"locked_version": "2.1.2"
|
||||
"locked_version": "2.3.2"
|
||||
},
|
||||
"erlang": {
|
||||
"locked_version": "1.4.2"
|
||||
},
|
||||
"apt": {
|
||||
"locked_version": "2.0.0"
|
||||
"locked_version": "2.3.4"
|
||||
},
|
||||
"database": {
|
||||
"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": {
|
||||
"yum": {
|
||||
"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": {
|
||||
"locked_version": "0.101.2"
|
||||
"locked_version": "1.0.0"
|
||||
},
|
||||
"xfs": {
|
||||
"locked_version": "1.1.0"
|
||||
},
|
||||
"erlang": {
|
||||
"locked_version": "1.3.0"
|
||||
},
|
||||
"yum": {
|
||||
"locked_version": "2.3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -1,3 +1,4 @@
|
|||
# encoding: UTF-8
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'chef', '~> 11.8'
|
||||
|
|
26
Gemfile.lock
26
Gemfile.lock
|
@ -9,12 +9,12 @@ GEM
|
|||
gyoku (>= 0.4.0)
|
||||
nokogiri (>= 1.4.0)
|
||||
ast (1.1.0)
|
||||
berkshelf (2.0.10)
|
||||
berkshelf (2.0.12)
|
||||
activesupport (~> 3.2.0)
|
||||
addressable (~> 2.3.4)
|
||||
buff-shell_out (~> 0.1)
|
||||
chozo (>= 0.6.1)
|
||||
faraday (>= 0.8.5)
|
||||
faraday (~> 0.8.5)
|
||||
hashie (>= 2.0.2)
|
||||
minitar (~> 0.5.4)
|
||||
rbzip2 (~> 0.2.0)
|
||||
|
@ -74,7 +74,7 @@ GEM
|
|||
coderay (1.1.0)
|
||||
diff-lcs (1.2.5)
|
||||
erubis (2.7.0)
|
||||
faraday (0.8.8)
|
||||
faraday (0.8.9)
|
||||
multipart-post (~> 1.2.0)
|
||||
fauxhai (2.0.1)
|
||||
net-ssh
|
||||
|
@ -91,10 +91,11 @@ GEM
|
|||
multi_json (~> 1.3)
|
||||
gssapi (1.0.3)
|
||||
ffi (>= 1.0.1)
|
||||
gyoku (1.1.0)
|
||||
gyoku (1.1.1)
|
||||
builder (>= 2.1.2)
|
||||
hashie (2.0.5)
|
||||
highline (1.6.20)
|
||||
hitimes (1.2.1)
|
||||
httpclient (2.3.4.1)
|
||||
httpi (0.9.7)
|
||||
rack
|
||||
|
@ -115,7 +116,7 @@ GEM
|
|||
mixlib-log (1.6.0)
|
||||
mixlib-shellout (1.3.0)
|
||||
moneta (0.6.0)
|
||||
multi_json (1.8.2)
|
||||
multi_json (1.8.4)
|
||||
multipart-post (1.2.0)
|
||||
net-http-persistent (2.9)
|
||||
net-ssh (2.7.0)
|
||||
|
@ -124,8 +125,8 @@ GEM
|
|||
net-ssh-multi (1.1)
|
||||
net-ssh (>= 2.1.4)
|
||||
net-ssh-gateway (>= 0.99.0)
|
||||
nio4r (0.5.0)
|
||||
nokogiri (1.5.10)
|
||||
nio4r (1.0.0)
|
||||
nokogiri (1.5.11)
|
||||
nori (1.1.5)
|
||||
ohai (6.20.0)
|
||||
ipaddress
|
||||
|
@ -135,7 +136,7 @@ GEM
|
|||
mixlib-shellout
|
||||
systemu (~> 2.5.2)
|
||||
yajl-ruby
|
||||
parser (2.1.2)
|
||||
parser (2.1.4)
|
||||
ast (~> 1.1)
|
||||
slop (~> 3.4, >= 3.4.5)
|
||||
polyglot (0.3.3)
|
||||
|
@ -148,11 +149,11 @@ GEM
|
|||
rack (~> 1.2)
|
||||
rack (1.5.2)
|
||||
rainbow (1.99.1)
|
||||
rake (10.1.0)
|
||||
rake (10.1.1)
|
||||
rbzip2 (0.2.0)
|
||||
rest-client (1.6.7)
|
||||
mime-types (>= 1.16)
|
||||
retryable (1.3.3)
|
||||
retryable (1.3.4)
|
||||
ridley (1.5.3)
|
||||
addressable
|
||||
buff-config (~> 0.2)
|
||||
|
@ -201,12 +202,13 @@ GEM
|
|||
buff-platform (~> 0.1)
|
||||
systemu (2.5.2)
|
||||
thor (0.18.1)
|
||||
timers (1.1.0)
|
||||
timers (2.0.0)
|
||||
hitimes
|
||||
treetop (1.4.15)
|
||||
polyglot
|
||||
polyglot (>= 0.3.1)
|
||||
uuidtools (2.1.4)
|
||||
varia_model (0.2.0)
|
||||
varia_model (0.3.2)
|
||||
buff-extensions (~> 0.2)
|
||||
hashie (>= 2.0.2)
|
||||
wasabi (1.0.0)
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
# Strainerfile
|
||||
rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK/Gemfile $SANDBOX/$COOKBOOK/metadata.rb --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
|
||||
rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK/ --config $SANDBOX/$COOKBOOK/.rubocop.yml
|
||||
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
|
||||
|
|
|
@ -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.
|
||||
|
||||
### 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 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.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# encoding: UTF-8
|
||||
#
|
||||
# Cookbook Name:: openstack-ops-messaging
|
||||
# Recipe:: default
|
||||
|
@ -18,10 +19,10 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
default["openstack"]["mq"]["bind_interface"] = "lo"
|
||||
default["openstack"]["mq"]["cluster"] = false
|
||||
default['openstack']['mq']['bind_interface'] = 'lo'
|
||||
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']['port'] = node['openstack']['mq']['port']
|
||||
default['openstack'][service]['rabbit']['username'] = node['openstack']['mq']['user']
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# encoding: UTF-8
|
||||
name 'openstack-ops-messaging'
|
||||
maintainer 'Opscode, Inc.'
|
||||
maintainer_email 'matt@opscode.com'
|
||||
maintainer 'Chef Software, Inc.'
|
||||
maintainer_email 'matt@getchef.com'
|
||||
license 'Apache 2.0'
|
||||
description 'Provides the shared messaging configuration for Chef for OpenStack.'
|
||||
version '8.0.1'
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# embedded attributes make for long lines
|
||||
LineLength:
|
||||
Enabled: false
|
|
@ -1,7 +0,0 @@
|
|||
# embedded attributes make for long lines
|
||||
LineLength:
|
||||
Enabled: false
|
||||
|
||||
# Allow small arrays before forcing %w or %W
|
||||
WordArray:
|
||||
MinSize: 3
|
Loading…
Reference in New Issue