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

Support Puppet >= 4.10 #50

Merged
merged 4 commits into from Apr 17, 2017
Merged

Support Puppet >= 4.10 #50

merged 4 commits into from Apr 17, 2017

Conversation

Phil-Friderici
Copy link

No description provided.

@Phil-Friderici
Copy link
Author

Rubocop seems to become more picky than in the past. I see 40 offenses within the existing code and this change is not even touching ruby code.

Phil Friderici added 2 commits April 11, 2017 10:23
Remove dependency on 'pe' as it will fail in any metadata-json-lint tests.
@Phil-Friderici Phil-Friderici changed the title Support Puppet >= 4.9 Support Puppet >= 4.10 Apr 11, 2017
Bundler/DuplicatedGem:
Exclude:
- "Gemfile"

Copy link
Author

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

Copy link
Owner

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.

Metrics/BlockLength:
Exclude:
- "spec/**/*.rb"

Copy link
Author

Choose a reason for hiding this comment

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

see rubocop/rubocop#3772 if interessted in more details

Copy link
Owner

Choose a reason for hiding this comment

The 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 lib/ ?

Copy link
Author

Choose a reason for hiding this comment

The 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.

# This cop isn't compatible with Ruby < 2.0
Style/SymbolArray:
Exclude:
- "Rakefile"
Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Owner

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

The 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.
You can see the actual error message in one of the failed tests [1].

[1] https://travis-ci.org/ghoneycutt/puppet-module-nscd/jobs/220867193#L213-L216

@ghoneycutt
Copy link
Owner

Yes, rubocop is not very stable. I'm all for standardized code but not at the cost of just continually churning it around. I'm happy to add a bunch of ignore/exclude lines :)

@@ -740,7 +740,7 @@
end

context 'as an array' do
let(:params) { { :package_name => %w(nscd foo) } }
let(:params) { { :package_name => %w[nscd foo] } }
Copy link
Owner

Choose a reason for hiding this comment

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

this seems like rubocop nonsense

Copy link
Author

Choose a reason for hiding this comment

The 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.

Copy link
Owner

Choose a reason for hiding this comment

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

Please do turn off the cop that wants to change all the %w() to %w[]. This way we reduce code churn and make other PR's easier to merge. Funny thing is we went to %w() because of rubocop :>

Other than that, everything looks good! Thanks!

@Phil-Friderici
Copy link
Author

@ghoneycutt please keep in mind that I only have disabled specific cops for specific files. This is the minimally invasive configuration change I could think of.

@@ -740,7 +740,7 @@
end

context 'as an array' do
let(:params) { { :package_name => %w(nscd foo) } }
let(:params) { { :package_name => %w[nscd foo] } }
Copy link
Owner

Choose a reason for hiding this comment

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

Please do turn off the cop that wants to change all the %w() to %w[]. This way we reduce code churn and make other PR's easier to merge. Funny thing is we went to %w() because of rubocop :>

Other than that, everything looks good! Thanks!

@ghoneycutt ghoneycutt merged commit e724227 into ghoneycutt:master Apr 17, 2017
@ghoneycutt
Copy link
Owner

Released in v1.10.0

@Phil-Friderici Phil-Friderici deleted the puppet49 branch April 18, 2017 06:39
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.

None yet

2 participants