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

Disable cop with potentially misleading warning message. #799

Merged
merged 1 commit into from
Nov 23, 2020

Conversation

phiggins
Copy link
Contributor

Signed-off-by: Pete Higgins pete@peterhiggins.org

This came up in the PR on chef/chef-server: https://github.com/chef/chef-server/pull/2174/files#r527113845

The warning from this cop led the PR author to change this code:

Chef::Node.send(:include, ChefOpsDCC::Helpers)

to this syntactically valid but incorrect code:

Chef::Node.send(include ChefOpsDCC::Helpers)

Signed-off-by: Pete Higgins <pete@peterhiggins.org>
@phiggins phiggins requested review from a team as code owners November 19, 2020 20:42
@lamont-granquist
Copy link
Contributor

I tend to think this is a good cop, but maybe needs to be engaged with the rubocop authors to clean up the warning message.

Also isn't there an autocorrect for this which does the right thing?

@phiggins
Copy link
Contributor Author

I tend to think this is a good cop, but maybe needs to be engaged with the rubocop authors to clean up the warning message.

I agree, I think the main problem with this is the warning message.

Also isn't there an autocorrect for this which does the right thing?

There is, but to someone unfamiliar with rubocop/chefstyle/cookstyle it's not obvious that that exists. I would be in favor of rubocop adding some kind of newbie friendly message at the end of a run that's something like there are warnings present that can be autofixed. Run $executable_name -a to fix them.

@tas50 tas50 merged commit 6a47272 into master Nov 23, 2020
@tas50 tas50 deleted the disable-send-with-mixin-argument branch November 23, 2020 15:38
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.

3 participants