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 white list for NamePrefixBlacklist #1825

Closed
Hanmac opened this issue Apr 23, 2015 · 6 comments
Closed

add white list for NamePrefixBlacklist #1825

Hanmac opened this issue Apr 23, 2015 · 6 comments

Comments

@Hanmac
Copy link

Hanmac commented Apr 23, 2015

i found after running rubocop on some of my gist files that it does have problems with defining "is_a?"
https://gist.github.com/Hanmac/4619845

  def is_a?(klass)
    super || __getobj__.is_a?(klass)
  end
@bbatsov
Copy link
Collaborator

bbatsov commented May 28, 2015

Yeah, this makes sense. Something like this would be useful for AccessorMethodName as well.

@alexdowad
Copy link
Contributor

Just opening a PR with NameWhitelist. @bbatsov, I can add the same for AccessorMethodName... but what will be on the default whitelist??

@Hanmac
Copy link
Author

Hanmac commented Nov 2, 2015

i don't know if its possible but i think there should be a whitelist check for all methods which are defined in parent classes/modules in case of overloading/overwriting of them (and the should be already reported in the parent class if they are part of the project too)

@alexdowad
Copy link
Contributor

Hmm, interesting idea. @bbatsov @jonas054 @rrosenblum What do you think of automatically whitelisting predicate methods which are known to exist in a parent class/module?

alexdowad added a commit to alexdowad/rubocop that referenced this issue Nov 2, 2015
@bbatsov
Copy link
Collaborator

bbatsov commented Nov 2, 2015

What do you think of automatically whitelisting predicate methods which are known to exist in a parent class/module?

This will be extremely hard to track down with our current approach which doesn't keep track of any file state. After all, the parent classes will likely be in other files.

@bbatsov
Copy link
Collaborator

bbatsov commented Nov 2, 2015

I can add the same for AccessorMethodName... but what will be on the default whitelist??

It can be just empty. I have the feeling many people would put get_ there. Anyways, I won't lose any sleep if we don't add this to RuboCop.

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

No branches or pull requests

3 participants