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 define_method to the list of IgnoredMethods of Style/SymbolProc #3028

Merged
merged 1 commit into from
Apr 13, 2016
Merged

Add define_method to the list of IgnoredMethods of Style/SymbolProc #3028

merged 1 commit into from
Apr 13, 2016

Conversation

jastkand
Copy link
Contributor

There is a code-sample:

[:block_code, :block_quote].each do |method|
  define_method(method) do |*args|
    args.first
  end
end

Using the default rubocop settings it produces such warning:

Pass &:first as an argument to define_method instead of a block. (Style/SymbolProc)

I think define_method should be added to a list of default IgnoredMethods of Style/SymbolicProc cop.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 13, 2016

Makes sense. Probably there are other similar methods worth ignoring. Add a changelog entry for this.

@jastkand
Copy link
Contributor Author

@bbatsov I've added the changelog entry to the New features section. Or maybe it was better to put it into Changes section?

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 13, 2016

I'd file this under changes.

@jastkand
Copy link
Contributor Author

@bbatsov I've updated and put it to Changes section.

@bbatsov bbatsov merged commit 837deda into rubocop:master Apr 13, 2016
@bbatsov
Copy link
Collaborator

bbatsov commented Apr 13, 2016

👍

Neodelf pushed a commit to Neodelf/rubocop that referenced this pull request Oct 15, 2016
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