Update attributes to be rubocop compliant

- Update rubocop config to handle entire repo in one file
- Update Strainerfile to run rubocop only once
- Update attributes to comply with rubocop

Change-Id: I299c2775a5a124b0af74f2e3d844cbd91f93380f
Addresses: blueprint rubocop-for-ops-database
This commit is contained in:
Andy McCrae 2014-01-17 17:14:09 +00:00
parent 6ef16628e5
commit 412512a33e
3 changed files with 31 additions and 16 deletions

View File

@ -1,7 +1,22 @@
# UTF-8 headers not generally in these files
Encoding:
Enabled: false
AllCops:
Includes:
- metadata.rb
- Gemfile
- attributes/**
Excludes:
- libraries/**
- providers/**
- recipes/**
- resources/**
- spec/**
Encoding:
Exclude:
- metadata.rb
- Gemfile
# ignore long lines
LineLength:
Enabled: false
WordArray:
MinSize: 3

View File

@ -1,6 +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
rubocop: bundle exec rubocop $SANDBOX/$COOKBOOK
knife test: bundle exec knife cookbook test $COOKBOOK
foodcritic: bundle exec foodcritic -f any -t ~FC003 -t ~FC023 $SANDBOX/$COOKBOOK
chefspec: bundle exec rspec $SANDBOX/$COOKBOOK/spec

View File

@ -1,3 +1,4 @@
# encoding: UTF-8#
#
# Cookbook Name:: openstack-ops-database
# Recipe:: default
@ -17,17 +18,17 @@
# limitations under the License.
#
default["openstack"]["db"]["bind_interface"] = "lo"
default['openstack']['db']['bind_interface'] = 'lo'
# Platform defaults
case platform
when "fedora", "redhat", "centos" # :pragma-foodcritic: ~FC024 - won"t fix this
default["openstack"]["db"]["platform"]["mysql_python_packages"] = [ "MySQL-python" ]
default["openstack"]["db"]["platform"]["postgresql_python_packages"] = [ "python-psycopg2" ]
when "suse"
default["openstack"]["db"]["platform"]["mysql_python_packages"] = [ "python-mysql" ]
default["openstack"]["db"]["platform"]["postgresql_python_packages"] = [ "python-psycopg2" ]
when "ubuntu"
default["openstack"]["db"]["platform"]["mysql_python_packages"] = [ "python-mysqldb" ]
default["openstack"]["db"]["platform"]["postgresql_python_packages"] = [ "python-psycopg2" ]
when 'fedora', 'redhat', 'centos' # :pragma-foodcritic: ~FC024 - won't fix this
default['openstack']['db']['platform']['mysql_python_packages'] = ['MySQL-python']
default['openstack']['db']['platform']['postgresql_python_packages'] = ['python-psycopg2']
when 'suse'
default['openstack']['db']['platform']['mysql_python_packages'] = ['python-mysql']
default['openstack']['db']['platform']['postgresql_python_packages'] = ['python-psycopg2']
when 'ubuntu'
default['openstack']['db']['platform']['mysql_python_packages'] = ['python-mysqldb']
default['openstack']['db']['platform']['postgresql_python_packages'] = ['python-psycopg2']
end