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 helper constants for nonmutating method names #8155

Closed
wants to merge 1 commit into from

Conversation

fatkodima
Copy link
Contributor

For context https://github.com/rubocop-hq/rubocop-performance/pull/140/files#r439732580

Bullet number 4

and those ENUMERABLE_METHOD_NAMES, NONMUTATING_ARRAY_METHODS and NONMUTATING_HASH_METHODS into rubocop-asts AST::CollectionNode module?

But it is not really belongs to rubocop-ast, I was wrong. So opened pr here.

@marcandre
Copy link
Contributor

it is not really belongs to rubocop-ast, I was wrong.

Why? IMO all criteria that are independent of a particular cop, that can be factually said to be accurate outside of a context, should be in rubocop-ast, these included.

@fatkodima
Copy link
Contributor Author

Ok. So is this file a good place for those constants https://github.com/rubocop-hq/rubocop-ast/blob/master/lib/rubocop/ast/node/mixin/method_identifier_predicates.rb ?
And if so, should I also add pedicate methods like nonmutable_array_method?, etc there?

@marcandre
Copy link
Contributor

I think so

@fatkodima
Copy link
Contributor Author

Opened on rubocop-ast rubocop/rubocop-ast#38

@fatkodima fatkodima closed this Jun 14, 2020
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