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

Add custom cops to Chefstyle #97

Merged
merged 11 commits into from
Aug 22, 2020
Merged

Add custom cops to Chefstyle #97

merged 11 commits into from
Aug 22, 2020

Conversation

tas50
Copy link
Contributor

@tas50 tas50 commented Aug 20, 2020

There are many things we need to do project wide that are a lot easier to accomplish with rubocop cops. This copies of the scaffolding to do that from Cookstyle and add the shellout cop from cookstyle as well as a new cop.

Note: these are at refactor level so they don't fail builds

TODO: tests

Signed-off-by: Tim Smith tsmith@chef.io

@tas50 tas50 added the Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number. label Aug 20, 2020
@tas50 tas50 requested review from a team as code owners August 20, 2020 15:36
There are many things we need to do project wide that are a lot easier to accomplish with rubocop cops. This copies of the scaffolding to do that from Cookstyle and add the shellout cop from cookstyle as well as a new cop.

Signed-off-by: Tim Smith <tsmith@chef.io>
config/chefstyle.yml Outdated Show resolved Hide resolved
tas50 and others added 2 commits August 20, 2020 10:45
Signed-off-by: Tim Smith <tsmith@chef.io>

Co-authored-by: pete higgins <pete@peterhiggins.org>
Use the new cop format and simplify how we extract the value

Signed-off-by: Tim Smith <tsmith@chef.io>
@phiggins
Copy link
Contributor

CI is unhappy:

rake aborted!
NameError: uninitialized constant RuboCop::Chef::CookbookHelpers
/workdir/lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb:36:in `<class:Ruby27KeywordArgumentWarnings>'
/workdir/lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb:35:in `<module:ChefRuby>'
/workdir/lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb:22:in `<module:Chef>'
/workdir/lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb:21:in `<module:Cop>'
/workdir/lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb:20:in `<module:RuboCop>'
/workdir/lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb:19:in `<top (required)>'
/workdir/lib/chefstyle.rb:37:in `require_relative'
/workdir/lib/chefstyle.rb:37:in `block in <top (required)>'
/workdir/lib/chefstyle.rb:34:in `glob'
/workdir/lib/chefstyle.rb:34:in `<top (required)>'
/workdir/Rakefile:23:in `require'
/workdir/Rakefile:23:in `<top (required)>'
/workdir/vendor/bundle/ruby/2.4.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:30:in `block in <main>'
/usr/local/bin/bundle:22:in `<main>'
(See full trace by running task with --trace)

Removed in cookstyle as well where it's not being used.

Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
There is no reason to do this.

Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
spec/spec_helper.rb Outdated Show resolved Hide resolved
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
Copy link
Contributor

@phiggins phiggins left a comment

Choose a reason for hiding this comment

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

Seems good to me 👍

@tas50 tas50 merged commit 9460ddb into master Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants