-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Puppet >= 4.10 #50
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,21 @@ AllCops: | |
|
||
# Cop's to ignore | ||
|
||
|
||
# It thinks that Ruby version dependend definitions are duplicates | ||
Bundler/DuplicatedGem: | ||
Exclude: | ||
- "Gemfile" | ||
|
||
# With this enabled it suggests a change that will break the Gemfile | ||
Lint/AssignmentInCondition: | ||
Enabled: false | ||
|
||
# It would need a complete rewrite of the test to get this cop satisfied | ||
Metrics/BlockLength: | ||
Exclude: | ||
- "spec/**/*.rb" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see rubocop/rubocop#3772 if interessted in more details There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why disable entirely on spec tests? Is the idea that we just use it for actual ruby code in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This cop get's angry about code blocks with more than 25 lines. It would need a complete refactor to satisfy him. The longest block is 1487 lines at the moment. I think this cop is good for real ruby code but not needed on the spec tests itself. |
||
Metrics/LineLength: | ||
Enabled: false | ||
|
||
|
@@ -28,6 +39,11 @@ Style/Next: | |
Style/NonNilCheck: | ||
Enabled: false | ||
|
||
# This cop isn't compatible with Ruby < 2.0 | ||
Style/SymbolArray: | ||
Exclude: | ||
- "Rakefile" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why ignore the Rakefile? I thought that since it is ruby, it should be tested. I'm not sure what I was supposed to get from looking at that Travis link. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This cop enforces to use a syntax that is not available on Ruby < 2.0. [1] https://travis-ci.org/ghoneycutt/puppet-module-nscd/jobs/220867193#L213-L216 |
||
|
||
Style/TrailingCommaInLiteral: | ||
Enabled: false | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -399,7 +399,7 @@ | |
}, | ||
} | ||
|
||
services_solaris = %w( | ||
services_solaris = %w[ | ||
audit_user | ||
auth_attr | ||
bootparams | ||
|
@@ -416,7 +416,7 @@ | |
tnrhdb | ||
tnrhtp | ||
user_attr | ||
) | ||
] | ||
|
||
platforms.sort.each do |_k, v| | ||
describe "on #{v[:osfamily]} #{v[:operatingsystemmajrelease]}#{v[:operatingsystemrelease]} with default values for all parameters" do | ||
|
@@ -740,7 +740,7 @@ | |
end | ||
|
||
context 'as an array' do | ||
let(:params) { { :package_name => %w(nscd foo) } } | ||
let(:params) { { :package_name => %w[nscd foo] } } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems like rubocop nonsense There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you don't like that, I can turn of the responding cop too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do turn off the cop that wants to change all the Other than that, everything looks good! Thanks! |
||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
||
it { should contain_package('nscd').with({ 'ensure' => 'present' }) } | ||
|
@@ -761,7 +761,7 @@ | |
|
||
describe 'with package_ensure parameter' do | ||
context 'set to all possible valid values' do | ||
%w(present installed absent).each do |ensure_value| | ||
%w[present installed absent].each do |ensure_value| | ||
context "package_ensure => #{ensure_value}" do | ||
let(:params) { { :package_ensure => ensure_value } } | ||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
@@ -812,7 +812,7 @@ | |
end | ||
|
||
context 'as an invalid type' do | ||
let(:params) { { :config_owner => %w(invalid root) } } | ||
let(:params) { { :config_owner => %w[invalid root] } } | ||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
||
it 'should fail' do | ||
|
@@ -832,7 +832,7 @@ | |
end | ||
|
||
context 'as an invalid type' do | ||
let(:params) { { :config_group => %w(invalid root) } } | ||
let(:params) { { :config_group => %w[invalid root] } } | ||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
||
it 'should fail' do | ||
|
@@ -896,7 +896,7 @@ | |
|
||
describe 'with service_ensure parameter' do | ||
context 'set to all possible valid values' do | ||
%w(present running absent stopped).each do |ensure_value| | ||
%w[present running absent stopped].each do |ensure_value| | ||
context "service_ensure => #{ensure_value}" do | ||
let(:params) { { :service_ensure => ensure_value } } | ||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
@@ -942,7 +942,7 @@ | |
end | ||
|
||
context 'set to invalid type' do | ||
let(:params) { { :service_enable => %w(invalid type) } } | ||
let(:params) { { :service_enable => %w[invalid type] } } | ||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
||
it 'should fail' do | ||
|
@@ -962,7 +962,7 @@ | |
end | ||
|
||
context 'as an invalid type' do | ||
let(:params) { { :service_provider => %w(not a string) } } | ||
let(:params) { { :service_provider => %w[not a string] } } | ||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
||
it 'should fail' do | ||
|
@@ -973,7 +973,7 @@ | |
end | ||
end | ||
|
||
%w(passwd group hosts services netgroup).each do |service| | ||
%w[passwd group hosts services netgroup].each do |service| | ||
describe "with enable_db_#{service}" do | ||
[true, 'true', false, 'false'].each do |value| | ||
context "set to valid value #{value}" do | ||
|
@@ -985,7 +985,7 @@ | |
end | ||
|
||
context 'set to an invalid type (non-boolean or string convertible to boolean)' do | ||
let(:params) { { :"enable_db_#{service}" => %w(invalid type) } } | ||
let(:params) { { :"enable_db_#{service}" => %w[invalid type] } } | ||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
||
it 'should fail' do | ||
|
@@ -1008,7 +1008,7 @@ | |
end | ||
|
||
context 'set to an invalid type (non-boolean or string convertible to boolean)' do | ||
let(:params) { { :enable_opt_auto_propagate => %w(invalid type) } } | ||
let(:params) { { :enable_opt_auto_propagate => %w[invalid type] } } | ||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
||
it 'should fail' do | ||
|
@@ -1220,7 +1220,7 @@ | |
end | ||
|
||
describe 'with paranoia parameter specified' do | ||
%w(yes no).each do |value| | ||
%w[yes no].each do |value| | ||
context "as valid value #{value}" do | ||
let(:params) { { :paranoia => value } } | ||
let(:facts) { { :osfamily => 'Debian' } } | ||
|
@@ -1274,9 +1274,9 @@ | |
end | ||
end | ||
|
||
%w(passwd group hosts services netgroup).each do |service| | ||
%w[passwd group hosts services netgroup].each do |service| | ||
describe "with #{service}_enable_cache specified" do | ||
%w(yes no).each do |value| | ||
%w[yes no].each do |value| | ||
context "as valid value #{value}" do | ||
let :params do | ||
{ | ||
|
@@ -1413,7 +1413,7 @@ | |
end | ||
|
||
describe "with #{service}_check_files specified" do | ||
%w(yes no).each do |value| | ||
%w[yes no].each do |value| | ||
context "as valid value #{value}" do | ||
let :params do | ||
{ | ||
|
@@ -1442,7 +1442,7 @@ | |
end | ||
|
||
describe "with #{service}_persistent specified" do | ||
%w(yes no).each do |value| | ||
%w[yes no].each do |value| | ||
context "as valid value #{value}" do | ||
let :params do | ||
{ | ||
|
@@ -1471,7 +1471,7 @@ | |
end | ||
|
||
describe "with #{service}_shared specified" do | ||
%w(yes no).each do |value| | ||
%w[yes no].each do |value| | ||
context "as valid value #{value}" do | ||
let :params do | ||
{ | ||
|
@@ -1538,7 +1538,7 @@ | |
# only the passwd and group services use auto-propogate | ||
if service == 'passwd' || service == 'group' | ||
describe "with #{service}_auto_propagate specified" do | ||
%w(yes no).each do |value| | ||
%w[yes no].each do |value| | ||
context "as valid value #{value}" do | ||
let :params do | ||
{ | ||
|
@@ -1570,7 +1570,7 @@ | |
|
||
services_solaris.each do |service| | ||
describe "with #{service}_enable_cache specified" do | ||
%w(yes no).each do |value| | ||
%w[yes no].each do |value| | ||
context "as valid value #{value}" do | ||
let(:params) { { :"#{service}_enable_cache" => value } } | ||
let(:facts) { { :osfamily => 'Solaris', :kernelrelease => '5.10' } } | ||
|
@@ -1656,7 +1656,7 @@ | |
end | ||
|
||
describe "with #{service}_check_files specified" do | ||
%w(yes no).each do |value| | ||
%w[yes no].each do |value| | ||
context "as valid value #{value}" do | ||
let(:params) { { :"#{service}_check_files" => value } } | ||
let(:facts) { { :osfamily => 'Solaris', :kernelrelease => '5.10' } } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see rubocop/rubocop#3752 if interessted in more details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, what a mess. Thanks for figuring this out.