Skip to content
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

Lint and rubocop (autofixes only) #289

Merged
merged 41 commits into from
Mar 8, 2019

Conversation

alexjfisher
Copy link
Member

This is in preparation of doing the first Vox Pupuli modulesync.

The following cops can not be autocorrected.

100  Lint/ParenthesesAsGroupedExpression
21   Style/RegexpLiteral
4    Style/GlobalVars
2    RSpec/MultipleExpectations
1    Lint/RescueException
1    Lint/UselessAssignment
1    Style/AccessorMethodName
1    Style/GuardClause
--
131  Total

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like my comments were usually fixed in a later commit. Probably still plenty of cleanups to be done, but this is a good start.

@@ -2,12 +2,12 @@

# CentOS 6 Redis package is too old for Sentinel (2.4.10, needs 2.8+)
describe 'redis::sentinel', unless: (fact('osfamily') == 'RedHat' && (fact('operatingsystemmajrelease') == '6')) do
case fact('osfamily')
redis_name = case fact('osfamily')
when 'Debian'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This when has a weird alignment

@@ -20,7 +20,7 @@ module Puppet::Parser::Functions
DOC
) do |args|

raise(Puppet::ParseError, "redisget(): Wrong number of arguments given (#{args.size} for 2 or 3)") if args.size != 2 and args.size != 3
raise(Puppet::ParseError, "redisget(): Wrong number of arguments given (#{args.size} for 2 or 3)") if args.size !=2 && args.size !=3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there no space after !=?

@@ -72,7 +72,7 @@
end

describe 'when an invalid type (non-string) is specified' do
before(:each) {
before {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? I never know

@@ -926,7 +926,8 @@

it { is_expected.to contain_file(config_file_orig).with(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's cleaner do use it do ... end (multi line) or it { is_expected.to contain_file(config_file_orig).with_content(/^slaveof _VALUE_/) }

@@ -5,24 +5,24 @@

it do
is_expected.to contain_sysctl('vm.overcommit_memory').with(
'ensure' => 'present',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny, this indentation was generated by another refactor

@@ -52,15 +52,15 @@
'mode' => '0644',
'owner' => 'redis',
'content' => $expected_noparams_content
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was also generated by another change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing fixes one cop at a time, I make sure I don't unfix cops I've already fixed (or introduce entirely new failing cops). For the ones I haven't, the number of failures can and does tend to increase though.

@alexjfisher alexjfisher merged commit cee701c into voxpupuli:master Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants